Add RedfishDriver on ManagementControllerDriver
The redfish driver implements get_facts, get_interfaces, get_interfaces_ip, get_environment, get_users, get_ntp_servers and get_snmp_information for the BMC, and the role methods get_power_state, set_power_state, get_hardware_inventory, get_event_log, get_firmware_inventory and get_management_protocols for the managed server. reboot_host resets the BMC through Manager.Reset, never the server. Registered as the napalm.drivers entry point redfish; depends on napalm and napalm-device-types >= 4.6.
This commit is contained in:
5 files changed
+1066
-6
No files matched your search
@@ -5,12 +5,11 @@ NAPALM driver for server **baseboard management controllers (BMCs)** over
|
||||
boards that predate Redfish. Built on
|
||||
[napalm-device-types](https://git.netork.io/NAPALM/napalm-device-types). Written for netOrk.
|
||||
|
||||
**Status: early development.** The HTTPS transport (`napalm_redfish/transport.py`) and pure
|
||||
parsers for the Redfish resources in [docs/redfish-map.md](docs/redfish-map.md)
|
||||
(`napalm_redfish/parsers/`) exist and are tested against DMTF mockups. The driver class and
|
||||
its `napalm.drivers` entry point wait for the `ManagementControllerDriver` role base in
|
||||
napalm-device-types. The first test device is a Supermicro X10DRL-i (BMC firmware 3.91,
|
||||
Redfish).
|
||||
**Status: early development.** The `redfish` driver (`napalm_redfish.RedfishDriver`, a
|
||||
`ManagementControllerDriver` from napalm-device-types) implements the NAPALM getters and
|
||||
the role methods in [docs/redfish-map.md](docs/redfish-map.md), tested end to end against
|
||||
DMTF mockups. It has not yet run against real hardware; the first test device is a
|
||||
Supermicro X10DRL-i (BMC firmware 3.91, Redfish). The `ipmi` fallback does not exist yet.
|
||||
|
||||
## Why Redfish, and why not one driver per vendor
|
||||
|
||||
@@ -64,10 +63,31 @@ These follow the other drivers in the `NAPALM` organisation:
|
||||
- `napalm-device-types` is not on PyPI: install it from
|
||||
`git+https://git.netork.io/NAPALM/napalm-device-types.git` before this package.
|
||||
|
||||
## Usage
|
||||
|
||||
```python
|
||||
import napalm
|
||||
|
||||
driver = napalm.get_network_driver("redfish")
|
||||
with driver("bmc01.example.net", "netork", "secret",
|
||||
optional_args={"verify_ssl": "/etc/netork/bmc-ca.pem"}) as bmc:
|
||||
bmc.get_facts() # the BMC: firmware as os_version, its ports
|
||||
bmc.get_power_state() # the server: {"state": "On", "actions": [...]}
|
||||
bmc.get_hardware_inventory()
|
||||
```
|
||||
|
||||
Optional args: `port` (443), `verify_ssl` (`True`, `False` or a CA file path; default
|
||||
`True`), `auth` (`auto`, `session` or `basic`; `auto` uses a Redfish session and falls back
|
||||
to basic auth only if the service cannot create sessions), `retries` (1).
|
||||
|
||||
`reboot_host` restarts the BMC, never the server; the server is switched through
|
||||
`set_power_state`. `get_config` is not implemented: a BMC has no configuration file.
|
||||
|
||||
## Development
|
||||
|
||||
```bash
|
||||
python -m venv .venv && . .venv/bin/activate
|
||||
pip install git+https://git.netork.io/NAPALM/napalm-device-types.git
|
||||
pip install -e '.[test]'
|
||||
pytest
|
||||
```
|
||||
|
||||
Reference in new issue
Block a user