Redfish_support - xcat2/xcat-core GitHub Wiki
To support Redfish interface for hardware control.
Add new mgt type ‘redfish’. Definition: mgt=redfish
Use the same table with openbmc, “#node,bmc,consport,taggedvlan,username,password,comments,disable".
/opt/xcat/lib/perl/xCAT_plugin/redfish.pm
/opt/xcat/lib/perl/xCAT/AGENT.pm (move agent related part from /opt/xcat/lib/perl/xCAT/OPENBMC.pm here)
/opt/xcat/lib/python/agent/xcatagent/redfish.py
/opt/xcat/lib/python/agent/hwctl/executor/redfish_power.py
/opt/xcat/lib/python/agent/hwctl/redfish_client.py
The main code logic:
- redfish.pm
- Handle xcat command. (rpower on)
- Check command and node definition error.
- Collect all nodes’ bmc, bmcip, bmcusername, bmcpassword
- Call AGENT.pm to call python agent
- AGENT.pm
- Collect xcat attributes xcatdebugmode, verbose,cwd, envs
- Start agent.py and build socket with python part
- Send all information (nodes and xcat attributes) to python part
- Receive socket message from python part and print out
- redfish.py
- Receive all info from perl part
- Parse and check args
- Deal with command, call corresponding task
RedfishPowerTask
and method to deal with subcommand
- redfish_power.py
- Send request and receive response data by calling redfish_client.py
- Deal with response data to send message back to perl
- redfish_client.py
- Do real work of send request and receive response by requests method
- Deal with response, check error and raise error
RedfishPowerTask is sub class of ParallelNodesCommand, call gevent to deal with command for each node at the same time.