Mojo::Redfish::Client - A Redfish client with a Mojo flair
my $client = Mojo::Redfish::Client->new(host => '192.168.0.1'); my $system = $client->root->get('/Systems')->get('/Members')->first; my $name = $system->value('/Name'); say "Name: $name";
Redfish is a modern standards-based system for querying computer systems for information. It replaces the existing IPMI "standard", such as it was, both in standardization and in using JSON over HTTP rather than binary protocols.
Mojo::Redfish::Client is, as the name suggests, a client for Redfish. It works to smooth out some of the common pain points of working with Redfish, especially the task of walking the data structure to find relevant information.
This is still a work-in-progress, however the author uses it in work application so every effort will be made to keep the api reasonably stable while improving where possible.
Mojo::Redfish::Client inherits all attributes from Mojo::Base and implements the following new ones.
The Redfish host. Required.
Password used for authentication by the default "ua" (with "username").
If true, the default "ua" will establish the connection using SSL/TLS. Default is true.
Session token to be used by the default "ua", overrides "username" and "password".
The instance of Mojo::UserAgent used to make requests. The default is an instance which subscribes to "prepare" in Mojo::UserAgent to set authentication and ssl.
Username used for authentication by the default "ua" (with "password").
Mojo::Redfish::Client inherits all methods from Mojo::Base and implements the following new ones.
my $result = $client->get('/redfish/v1/Systems');
Requests the requested url via the "ua". Returns an instance of Mojo::Redfish::Client::Result. Dies on errors (the exact exception and behavior is subject to change).
my $result = $client->root;
Requests the Redfish root url (/redfish/v1) from the "host" via "get" or fetches a cached copy. Caches and returns the result.
/redfish/v1
# same as (except for the caching) my $result = $client->get('/redfish/v1');
This module is still in early development. Future work will include
Non-blocking (promise-based) api
Session management
Testing
This module's development was sponsored by ServerCentral Turing Group.
http://github.com/jberger/Mojo-Redfish-Client
Joel Berger, <joel.a.berger@gmail.com>
None yet.
Copyright (C) 2019 by "AUTHOR" and "CONTRIBUTORS"
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Mojo::Redfish::Client, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojo::Redfish::Client
CPAN shell
perl -MCPAN -e shell install Mojo::Redfish::Client
For more information on module installation, please visit the detailed CPAN module installation guide.