kvmfleet-bmc-adapters 0.7.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. kvmfleet_bmc_adapters-0.7.0/.github/workflows/ci.yml +35 -0
  2. kvmfleet_bmc_adapters-0.7.0/.github/workflows/release.yml +39 -0
  3. kvmfleet_bmc_adapters-0.7.0/.gitignore +13 -0
  4. kvmfleet_bmc_adapters-0.7.0/CHANGELOG.md +289 -0
  5. kvmfleet_bmc_adapters-0.7.0/LICENSE +201 -0
  6. kvmfleet_bmc_adapters-0.7.0/PKG-INFO +764 -0
  7. kvmfleet_bmc_adapters-0.7.0/README.md +517 -0
  8. kvmfleet_bmc_adapters-0.7.0/bmc_adapters/__init__.py +129 -0
  9. kvmfleet_bmc_adapters-0.7.0/bmc_adapters/base.py +95 -0
  10. kvmfleet_bmc_adapters-0.7.0/bmc_adapters/bmc.py +119 -0
  11. kvmfleet_bmc_adapters-0.7.0/bmc_adapters/cli.py +204 -0
  12. kvmfleet_bmc_adapters-0.7.0/bmc_adapters/findings.py +131 -0
  13. kvmfleet_bmc_adapters-0.7.0/bmc_adapters/ipmi/__init__.py +48 -0
  14. kvmfleet_bmc_adapters-0.7.0/bmc_adapters/ipmi/client.py +382 -0
  15. kvmfleet_bmc_adapters-0.7.0/bmc_adapters/ipmi/sol.py +121 -0
  16. kvmfleet_bmc_adapters-0.7.0/bmc_adapters/ipmi/types.py +79 -0
  17. kvmfleet_bmc_adapters-0.7.0/bmc_adapters/pdu/__init__.py +52 -0
  18. kvmfleet_bmc_adapters-0.7.0/bmc_adapters/pdu/_snmp.py +146 -0
  19. kvmfleet_bmc_adapters-0.7.0/bmc_adapters/pdu/apc.py +168 -0
  20. kvmfleet_bmc_adapters-0.7.0/bmc_adapters/pdu/base.py +115 -0
  21. kvmfleet_bmc_adapters-0.7.0/bmc_adapters/pdu/cyberpower.py +120 -0
  22. kvmfleet_bmc_adapters-0.7.0/bmc_adapters/pdu/detect.py +35 -0
  23. kvmfleet_bmc_adapters-0.7.0/bmc_adapters/pdu/eaton.py +133 -0
  24. kvmfleet_bmc_adapters-0.7.0/bmc_adapters/pdu/raritan.py +204 -0
  25. kvmfleet_bmc_adapters-0.7.0/bmc_adapters/pdu/tripplite.py +109 -0
  26. kvmfleet_bmc_adapters-0.7.0/bmc_adapters/pikvm/__init__.py +19 -0
  27. kvmfleet_bmc_adapters-0.7.0/bmc_adapters/pikvm/client.py +124 -0
  28. kvmfleet_bmc_adapters-0.7.0/bmc_adapters/racadm/__init__.py +29 -0
  29. kvmfleet_bmc_adapters-0.7.0/bmc_adapters/racadm/client.py +167 -0
  30. kvmfleet_bmc_adapters-0.7.0/bmc_adapters/racadm/parsers.py +65 -0
  31. kvmfleet_bmc_adapters-0.7.0/bmc_adapters/redfish/__init__.py +65 -0
  32. kvmfleet_bmc_adapters-0.7.0/bmc_adapters/redfish/client.py +1508 -0
  33. kvmfleet_bmc_adapters-0.7.0/bmc_adapters/redfish/errors.py +10 -0
  34. kvmfleet_bmc_adapters-0.7.0/bmc_adapters/redfish/types.py +362 -0
  35. kvmfleet_bmc_adapters-0.7.0/bmc_adapters/redfish/validate.py +119 -0
  36. kvmfleet_bmc_adapters-0.7.0/bmc_adapters/transport/__init__.py +11 -0
  37. kvmfleet_bmc_adapters-0.7.0/bmc_adapters/transport/ssh.py +157 -0
  38. kvmfleet_bmc_adapters-0.7.0/bmc_adapters/wol.py +62 -0
  39. kvmfleet_bmc_adapters-0.7.0/docs/contributing.md +70 -0
  40. kvmfleet_bmc_adapters-0.7.0/docs/supported-vendors.md +73 -0
  41. kvmfleet_bmc_adapters-0.7.0/pyproject.toml +95 -0
  42. kvmfleet_bmc_adapters-0.7.0/tests/__init__.py +0 -0
  43. kvmfleet_bmc_adapters-0.7.0/tests/test_cli.py +133 -0
  44. kvmfleet_bmc_adapters-0.7.0/tests/test_findings.py +45 -0
  45. kvmfleet_bmc_adapters-0.7.0/tests/test_pdu_detect.py +24 -0
  46. kvmfleet_bmc_adapters-0.7.0/tests/test_pikvm.py +77 -0
  47. kvmfleet_bmc_adapters-0.7.0/tests/test_racadm_parsers.py +67 -0
  48. kvmfleet_bmc_adapters-0.7.0/tests/test_redfish_client.py +362 -0
  49. kvmfleet_bmc_adapters-0.7.0/tests/test_redfish_paging.py +118 -0
  50. kvmfleet_bmc_adapters-0.7.0/tests/test_redfish_sse.py +120 -0
  51. kvmfleet_bmc_adapters-0.7.0/tests/test_redfish_validate.py +93 -0
  52. kvmfleet_bmc_adapters-0.7.0/tests/test_redfish_vendor_detect.py +147 -0
  53. kvmfleet_bmc_adapters-0.7.0/tests/test_wol.py +62 -0
@@ -0,0 +1,35 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ python-version: ["3.11", "3.12"]
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+
18
+ - name: Set up Python ${{ matrix.python-version }}
19
+ uses: actions/setup-python@v5
20
+ with:
21
+ python-version: ${{ matrix.python-version }}
22
+
23
+ - name: Install dependencies
24
+ run: |
25
+ python -m pip install --upgrade pip
26
+ pip install -e ".[dev]"
27
+
28
+ - name: Lint with ruff
29
+ run: ruff check .
30
+
31
+ - name: Typecheck with mypy
32
+ run: mypy bmc_adapters
33
+
34
+ - name: Run tests
35
+ run: pytest -v
@@ -0,0 +1,39 @@
1
+ name: Release
2
+
3
+ # Publishes to PyPI when a version tag is pushed (e.g. `v0.7.0`). Uses PyPI
4
+ # Trusted Publishing (OIDC) — no API token stored in the repo. This requires a
5
+ # one-time setup on PyPI: project settings → Publishing → add a GitHub
6
+ # publisher for owner `KVMFleet`, repo `bmc-adapters`, workflow `release.yml`,
7
+ # environment `pypi`.
8
+ on:
9
+ push:
10
+ tags:
11
+ - "v*"
12
+
13
+ jobs:
14
+ build-and-publish:
15
+ runs-on: ubuntu-latest
16
+ environment: pypi
17
+ permissions:
18
+ id-token: write # OIDC token for Trusted Publishing
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+
22
+ - name: Set up Python
23
+ uses: actions/setup-python@v5
24
+ with:
25
+ python-version: "3.12"
26
+
27
+ - name: Install build + test deps
28
+ run: |
29
+ python -m pip install --upgrade pip
30
+ pip install -e ".[dev,all]" build
31
+
32
+ - name: Test (gate the publish on a green suite)
33
+ run: pytest -q
34
+
35
+ - name: Build sdist + wheel
36
+ run: python -m build
37
+
38
+ - name: Publish to PyPI
39
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,13 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *.egg-info/
4
+ .eggs/
5
+ .pytest_cache/
6
+ .mypy_cache/
7
+ .ruff_cache/
8
+ .venv/
9
+ venv/
10
+ dist/
11
+ build/
12
+ .coverage
13
+ htmlcov/
@@ -0,0 +1,289 @@
1
+ # Changelog
2
+
3
+ All notable changes to `kvmfleet-bmc-adapters` are recorded here.
4
+ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/);
5
+ versioning is [SemVer](https://semver.org/).
6
+
7
+ ## [0.7.0] — 2026-06-15
8
+
9
+ ### Added — Command-line interface (`kvmfleet-bmc`)
10
+
11
+ A new console script ships with the package — an operator CLI over the async
12
+ Redfish client. It's a thin dispatch layer with no behaviour of its own; the
13
+ library remains the primary surface.
14
+
15
+ - `kvmfleet-bmc --host <url> -u <user> info` — make / model / serial /
16
+ firmware inventory.
17
+ - `kvmfleet-bmc ... power {status,on,off,off-hard,cycle,reboot}` — power
18
+ control and current state.
19
+ - `kvmfleet-bmc ... thermal` — temperature and fan readings.
20
+ - `kvmfleet-bmc ... health` — power state + health rollup; exits non-zero
21
+ (3) when health is not OK, so it drops straight into monitoring.
22
+ - Password via `--password` or the `BMC_PASSWORD` environment variable
23
+ (preferred — keeps it out of the process table and shell history).
24
+ - `--json` on every command for machine-readable output.
25
+ - TLS verification is off by default (BMCs ship self-signed certs); pass
26
+ `--verify-tls` to enforce it.
27
+
28
+ ### Added — Redfish Server-Sent Events (`RedfishClient.stream_events`)
29
+
30
+ - `stream_events()` — async generator that opens the BMC's Redfish
31
+ EventService SSE stream (`ServerSentEventUri`) and yields
32
+ `RedfishEventRecord`s as the BMC pushes them (power, thermal, lifecycle
33
+ alerts) — no polling. Runs until the stream closes or the caller stops
34
+ iterating; no read timeout, but a connect timeout so a dead BMC fails fast.
35
+ - `event_service_sse_uri()` — returns the SSE URI, or `None` when the BMC has
36
+ no EventService / doesn't advertise SSE (the signal to fall back to
37
+ `sel_entries()` polling). Vendor support varies (common on iDRAC9 / iLO5 /
38
+ OpenBMC; absent on older firmware).
39
+ - `RedfishEventRecord` dataclass — `message_id`, `message`, `severity`,
40
+ `event_type`, `event_timestamp`, `origin_of_condition`, and `raw`.
41
+ - Tolerant SSE framing: keep-alive comment lines are skipped, both the
42
+ `Event`-with-`Events[]` and bare-record payload shapes are handled, and
43
+ malformed JSON from a noisy BMC is dropped rather than crashing the consumer.
44
+
45
+ ### Added — Redfish collection pagination + `$expand` (fleet scale)
46
+
47
+ - `RedfishClient` now follows `Members@odata.nextLink` on every collection it
48
+ walks (processors, memory, drives, volumes, NICs, firmware, SEL, BMC users),
49
+ so dense chassis and long event logs no longer silently lose members past
50
+ the first page.
51
+ - `expand_collection(path)` — read a whole collection in one paginated
52
+ `$expand=.($levels=1)` sweep (member bodies inlined, no N+1 round-trips),
53
+ falling back to plain paginated reads when the BMC rejects `$expand`.
54
+ - The internal collection walker takes an optional `limit` so capped reads
55
+ (e.g. `sel_entries(limit=…)`) stop paging once they have enough.
56
+
57
+ ### Added — Opt-in Redfish response validation
58
+
59
+ - `validate_redfish_resource(data)` — dependency-free check of the Redfish
60
+ structural contract: required `@odata.id`, well-formed `@odata.type`,
61
+ collection consistency (`Members` list, `Members@odata.count` vs page),
62
+ and legal `Status.Health` / `Status.State` / `PowerState` enum values.
63
+ Returns collected `RedfishValidationIssue`s; never raises.
64
+ - `validate_against_schema(data, schema)` — full JSON-Schema validation
65
+ against a schema *you* supply, via the optional `jsonschema` dependency
66
+ (`pip install 'kvmfleet-bmc-adapters[schema]'`). The multi-megabyte DMTF
67
+ schema set is intentionally **not** vendored — point this at your own copy.
68
+ - `RedfishClient.validate_resource(path, *, schema=None)` — GET + validate.
69
+
70
+ ### Added — Wider vendor recognition
71
+
72
+ - `detect_vendor()` now recognises **Cisco** (CIMC/UCS → `cisco-cimc`),
73
+ **Fujitsu** (PRIMERGY iRMC → `fujitsu-irmc`), **Huawei** (iBMC →
74
+ `huawei-ibmc`), and **OpenBMC** (→ `openbmc`) from their documented Oem
75
+ keys / Manager ids, alongside the existing iDRAC / iLO / Supermicro /
76
+ Lenovo XCC. These all speak standard Redfish, so the client's operations
77
+ work regardless of the label — it just drives caller branching and
78
+ incremental per-vendor quirk handling.
79
+ - Plus the **AMI MegaRAC whitebox family** — `gigabyte`, `asrockrack`,
80
+ `tyan`, `quanta`, `inspur`, and the generic `ami-megarac` OEM stack
81
+ (specific vendor key wins over the generic AMI key). These boards already
82
+ worked via the `redfish-generic` path; naming them lets callers branch and
83
+ enables the right per-board firmware findings. **Recognised from documented
84
+ signatures, not yet hardware-verified** (see README) — no overclaim.
85
+
86
+ ### Fixed
87
+
88
+ - Collection-iterating methods previously read only the first page of
89
+ paginated collections — now corrected (see above).
90
+ - `ACTION_TO_REDFISH` contract test now covers the `reboot` verb.
91
+
92
+ ## [0.6.0] — 2026-06-06
93
+
94
+ Tier 3: Dell RACADM legacy adapter and a reusable async-SSH
95
+ transport. Scope intentionally tight — 10 commands cover the
96
+ operator surface that Redfish doesn't reach on iDRAC6/7 (and the
97
+ "Redfish wedged, fall back" path on iDRAC8/9).
98
+
99
+ ### Added — Shared SSH transport (`bmc_adapters.transport.ssh`)
100
+
101
+ - `AsyncSSHCLIClient` — persistent asyncssh connection with
102
+ bounded per-host concurrency, idle-friendly defaults, and
103
+ legacy KEX / host-key algorithm support for older BMCs
104
+ (iDRAC6/7, older CMC).
105
+ - `SSHCreds` — username + password / key pair.
106
+ - Used by the RACADM adapter; reserved for future SSH-CLI
107
+ wrappers.
108
+
109
+ ### Added — Dell RACADM adapter (`bmc_adapters.racadm`)
110
+
111
+ - `RACADMClient` — async wrapper around the `racadm` SSH shell.
112
+ - 10-command core:
113
+ - Power: `power_action` (on/off/off_hard/cycle/reboot/soft),
114
+ `power_status`.
115
+ - Inventory: `get_system_info`, `get_version`,
116
+ `get_service_tag`.
117
+ - Logs: `get_sel`.
118
+ - BMC mgmt: `racreset` (soft / hard).
119
+ - Property DB: `get(fqdd)`, `set(fqdd, value)`.
120
+ - Per-command parsers; permissive against firmware-version
121
+ output churn.
122
+ - Optional dependency — install with `[ssh]` extra
123
+ (`pip install 'kvmfleet-bmc-adapters[ssh]'`).
124
+
125
+ ### Dropped from scope (intentional)
126
+
127
+ - **HPE RIBCL** — iLO 4 firmware ≥ 2.30 (April 2016) has
128
+ working Redfish. iLO 5/6 are Redfish-first. Niche of a
129
+ shrinking niche. Implement only if a paying customer asks.
130
+ - **Supermicro SUM / SMCIPMITool** — closed-source; can't
131
+ bundle. Redfish covers X12+.
132
+ - **Lenovo OneCLI** — XCC3 is Redfish-aligned by design.
133
+ Closed-source.
134
+ - **Cisco UCS IMC** — wrong audience (Intersight shops).
135
+ - **OpenBMC console** — console multiplexing is a different
136
+ product surface entirely.
137
+
138
+ ## [0.5.0] — 2026-06-05
139
+
140
+ Tier 2 expansion: PiKVM ATX, IPMI Serial-over-LAN, and two more
141
+ PDU vendors.
142
+
143
+ ### Added — PiKVM adapter
144
+
145
+ - `bmc_adapters.pikvm.PiKVMClient` — async client for PiKVM's
146
+ `kvmd` ATX endpoint (`/api/atx`, `/api/atx/power?action=...`).
147
+ Friendly verbs `on / off / off_hard / cycle / reboot` collapse
148
+ to kvmd's ATX action set.
149
+ - Default-credential finding for the documented `admin/admin`.
150
+ - Useful when KVM Fleet (or any orchestrator) needs to address a
151
+ PiKVM-managed target under the same shape as a BMC.
152
+
153
+ ### Added — IPMI Serial-over-LAN
154
+
155
+ - `bmc_adapters.ipmi.sol_session(client)` — async context manager
156
+ that wraps `pyghmi.ipmi.console.Console` callbacks behind an
157
+ async iterator + send coroutine pair.
158
+ - Always sends Deactivate Payload on exit (Supermicro X10 SoL
159
+ hang fix).
160
+
161
+ ### Added — PDU vendors
162
+
163
+ - `bmc_adapters.pdu.TrippLitePDUClient` — Tripp Lite WEBCARDLX
164
+ (TRIPPLITE-PRODUCTS-MIB).
165
+ - `bmc_adapters.pdu.CyberPowerPDUClient` — CyberPower
166
+ PDU15Mxxx/20Mxxx/30Mxxx (CyberPower-MIB).
167
+
168
+ ### Deferred from this release
169
+
170
+ - JetKVM adapter — held until we have hardware to test against
171
+ (per the project's no-overpromising rule).
172
+
173
+ ## [0.4.0] — 2026-06-05
174
+
175
+ Multi-protocol expansion. The library is no longer Redfish-only — it
176
+ now covers the operator-facing surface across every relevant out-of-
177
+ band path.
178
+
179
+ ### Added — IPMI
180
+
181
+ - `bmc_adapters.ipmi.IPMIClient` — async wrapper around `pyghmi`
182
+ (Apache 2.0). Mirrors `RedfishClient` shape: `power_action`,
183
+ `chassis_status`, `sensors`, `fru`, `sel_entries`, `sel_clear`.
184
+ - Secure defaults: refuses IPMI 1.5, refuses cipher suites
185
+ 0/1/2/6/7/8/11/12, prefers cipher 17 (SHA-256) and falls back to
186
+ cipher 3 (SHA-1).
187
+ - Default-credential detection — constant-time compare against a
188
+ documented vendor/user/password table. The library never *probes*
189
+ the BMC with a default cred; the check is local.
190
+ - Vendor fingerprinting via Get Device ID Manufacturer ID (IANA
191
+ Enterprise number).
192
+ - Optional dependency — install with `[ipmi]` extra.
193
+
194
+ ### Added — Smart PDU control
195
+
196
+ - `bmc_adapters.pdu.APCPDUClient` — APC AP86xx / AP88xx / AP89xx via
197
+ SNMPv2c or SNMPv3 (PowerNet-MIB).
198
+ - `bmc_adapters.pdu.EatonPDUClient` — Eaton ePDU G4 via
199
+ EATON-EPDU-MIB.
200
+ - `bmc_adapters.pdu.RaritanPDUClient` — Raritan PX2 / PX3 / PX4 (and
201
+ rebranded Legrand PDUs) via JSON-RPC over HTTPS.
202
+ - `bmc_adapters.pdu.vendor_from_sysobjectid()` — vendor auto-detect
203
+ from SNMP `sysObjectID` prefix.
204
+ - Refuses SNMPv2c by default unless `allow_snmpv2c=True` is passed;
205
+ emits `PDU_SNMPV2C_PLAINTEXT` finding when accepted.
206
+ - Default-credential warnings for APC `apc/apc`, Raritan
207
+ `admin/raritan`, Legrand `admin/legrand@1`.
208
+ - Optional dependency — install with `[pdu]` extra.
209
+
210
+ ### Added — Wake-on-LAN
211
+
212
+ - `bmc_adapters.wake_on_lan()` — async wrapper around the stdlib
213
+ socket sender; pure-stdlib, no dependency.
214
+ - `bmc_adapters.wake_on_lan_sync()` — synchronous variant.
215
+
216
+ ### Added — Cross-protocol orchestration
217
+
218
+ - `bmc_adapters.BMC` — top-level orchestrator composing Redfish +
219
+ IPMI + PDU adapters. Dispatches `power_action` to the first
220
+ adapter that supports it. Inspired by `bmclib`'s registry
221
+ pattern (github.com/bmc-toolbox/bmclib).
222
+ - `bmc_adapters.BMCFinding` — structured security observations
223
+ emitted by adapters (cipher 0 accepted, default credentials
224
+ matched, Pantsdown firmware window, etc.). JSON-serialisable
225
+ via `.to_dict()`. Hooks into KVM Fleet's Merkle audit chain in
226
+ the hosted product.
227
+ - `bmc_adapters.Feature` enum — taxonomy of operations an OOB
228
+ path may support (POWER_STATE, OUTLET_CONTROL, SOL, SEL_READ,
229
+ ...). Used by the orchestrator for feature dispatch.
230
+ - `bmc_adapters.matches_default_credential()` — constant-time
231
+ detector for documented vendor/user/password defaults.
232
+ - `bmc_adapters.pantsdown_finding()` — Pantsdown / CVE-2019-6260
233
+ fingerprint helper for AST2400/AST2500 BMC firmware.
234
+
235
+ ### Changed
236
+
237
+ - README hero rewritten to reflect multi-protocol scope.
238
+ - Package `description` updated.
239
+ - `keywords` expanded.
240
+
241
+ ### Migration notes
242
+
243
+ All v0.3.0 APIs (`RedfishClient` and friends) remain compatible.
244
+ No breaking changes. The new protocol modules are independent.
245
+
246
+ ## [0.3.0] — 2026-06-05
247
+
248
+ Maximise-within-scope pass: expand `RedfishClient` from a platform-pull
249
+ minimum to the full operator surface a BMC adapter should reasonably
250
+ expose. No breaking changes — all v0.1.0 APIs remain.
251
+
252
+ ### Added (23 methods)
253
+
254
+ - **Identity + topology** — `system_info`, `chassis_health`
255
+ - **Sensors** — `temperatures`, `fans`, `power_supplies`, `power_metrics`
256
+ - **Inventory** — `processors`, `memory_modules`, `drives`, `volumes`,
257
+ `network_adapters`, `firmware_inventory`
258
+ - **Boot** — `boot_config`, `set_next_boot`, `set_boot_order`
259
+ - **System event log** — `sel_entries`, `clear_sel` (probes SEL,
260
+ iDRAC Lifecycle, and iLO IML registries in turn)
261
+ - **BIOS / settings** — `bios_attributes`, `set_bios_attribute`
262
+ - **Power control extras** — `force_off`, `graceful_shutdown`,
263
+ `graceful_restart`, `nmi`
264
+
265
+ All new methods follow the existing async + vendor-quirks-handling
266
+ pattern from v0.1.0; tests use `respx` to mock vendor responses.
267
+
268
+ ## [0.1.0] — 2026-06-03
269
+
270
+ Initial public release. Extracted from the production KVM Fleet platform
271
+ code (in production since 2026-Q2) under Apache 2.0.
272
+
273
+ ### Added
274
+
275
+ - `RedfishClient` — async Redfish client with:
276
+ - SessionService auth + HTTP Basic-auth fallback for vendor firmware
277
+ that returns 204/404/405/2xx-without-token on `/SessionService/Sessions`
278
+ - Cached session token with auto-refresh + retry-on-401
279
+ - Per-client TLS-verify toggle (defaults false because of factory
280
+ self-signed certs)
281
+ - Plaintext-or-callable password source (sync + async callable)
282
+ - Power actions mapped from four friendly verbs (`on` / `off` /
283
+ `off_hard` / `cycle`) to `ComputerSystem.Reset`
284
+ - Virtual media insert / eject with vendor-quirks handling (pre-eject
285
+ busy slots, fall back to first slot when MediaTypes missing)
286
+ - `HeartbeatSnapshot` dataclass for poll-cycle state
287
+ - `RedfishError` for protocol-level failures
288
+ - Test suite using `respx` to mock httpx — no live BMC required
289
+ - CI: ruff + mypy + pytest on Python 3.11 / 3.12
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for describing the origin of the Work and
141
+ reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Support. While redistributing the Work or
166
+ Derivative Works thereof, You may choose to offer, and charge a
167
+ fee for, acceptance of support, warranty, indemnity, or other
168
+ liability obligations and/or rights consistent with this License.
169
+ However, in accepting such obligations, You may act only on Your
170
+ own behalf and on Your sole responsibility, not on behalf of any
171
+ other Contributor, and only if You agree to indemnify, defend,
172
+ and hold each Contributor harmless for any liability incurred by,
173
+ or claims asserted against, such Contributor by reason of your
174
+ accepting any such warranty or support.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 KVM Fleet
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.