A small, read-only Redfish inventory client for MoonBit native applications
moon run examples/offline --target native///|
test "parse synthetic inventory" {
let node = @moonredfish.parse_resource("/redfish/v1/Systems/demo", {
"Id": "demo",
"Name": "Synthetic server",
"PowerState": "On",
})
assert_eq(node.string("PowerState"), Some("On"))
}# Only with authorization for the target. This example performs anonymous HTTPS reads.
moon run examples/inventory --target native -- https://authorized-bmc.example.invalidmoon update
moon check --target native --deny-warn
moon test --target native --deny-warn
moon run examples/offline --target native
python3 tools/test_mock.py
moon info --target native
moon fmt --check
moon package --listpub suberror RedfishError {
InvalidEndpoint
InvalidPath
InvalidOptions
InvalidResponse(String)
HttpStatus(Int)
ResponseTooLarge
PageLimit
PaginationCycle
SessionAlreadyActive
NoSession
} derive(Debug)type Clientfn Client::new(endpoint : String, ca_file? : String, allow_loopback_http? : Bool, timeout_ms? : Int, max_response_bytes? : Int, max_pages? : Int) -> Client raise RedfishErrorInstall
Download zipA small, read-only Redfish inventory client for MoonBit native applications