redfishtool is a commandline tool that implements the client side of the Redfish RESTful API for Data Center Hardware Management.
redfishtool是一个命令行工具,用于实现用于数据中心硬件管理的 Redfish RESTful API 的客户端。
Redfishtool 是DMTF用python3來開發的,我們可以透過Redfishtool 來下指令給redfish,通常很少會用到這個tool,因為postman和curl其實就很好用了,但基于好奇我决定装来玩看看,它的安裝指令
// Update the package ind
$ sudo apt-get update
// Install redfishtool deb package
$ sudo apt-get install redfishtool
安装成功后,可以下"redfishtool -V"来查看版本
$ redfishtool -V
redfishtool Version: 1.1.5
查看有哪些指令可以使用redfishtool -h
$ redfishtool -h
Usage:
redfishtool: {} [OPTIONS] <SubCommand> <operation> [<args>]...
redfishtool: {} [OPTIONS] hmraw <method> <hmUrl> [<data>]
Common OPTIONS:
-V, --version -- show redfishtool version, and exit
-h, --help -- show Usage, Options, and list of subCommands, and exit
-v, --verbose -- verbose level, can repeat up to 5 times for more verbose output
-v(header), -vv(+addl info), -vvv(Request trace), -vvvv(+subCmd dbg), -vvvvv(max dbg)
-s, --status -- status level, can repeat up to 5 times for more status output
-s(http_status),
-ss(+r.url, +r.elapsed executionTime ),
-sss(+request hdrs,data,authType, +response status_code, +response executionTime,
+login auth token/sessId/sessUri)
-ssss(+response headers), -sssss(+response data
-u <user>, --user=<usernm> -- username used for remote redfish authentication
-p <passwd>, --password=<passwd> -- password used for remote redfish authentication
-r <rhost>, --rhost=<rhost> -- remote redfish service hostname or IP:port
-t <token>, --token=<token> -- redfish auth session token-for sessions across multiple calls
-q, --quiet -- quiet mode--suppress error, warning, and diagnostic messages
-c <cfgFile>,--config=<cfgFile> -- read options (including credentials) from file <cfgFile>
-T <timeout>,--Timeout=<timeout> -- timeout in seconds for each http request. Default=10
-P <property>, --Prop=<property> -- return only the specified property. Applies only to all "get" operations
-E, --Entries -- Fetch the Logs entries. Applies to Logs sub-command of Systems, Chassis and Managers
Options used by "raw" subcommand:
-d <data> --data=<data> -- the http request "data" to send on PATCH,POST,or PUT requests
Options to specify top-level collection members: eg: Systems -I <sysId>
-I <Id>, --Id=<Id> -- Use <Id> to specify the collection member
-M <prop>:<val&

Redfishtool是一个Python3命令行工具,实现了Redfish RESTful API的客户端,用于数据中心硬件管理。它提供了一系列方便的子命令,如GET、PATCH、POST等,用于操作如系统、 chassis、managers等资源。通过Redfishtool,用户可以执行类似于curl和Postman的HTTP请求,但其命令更简洁,且内置了一些管理操作。例如,可以创建、获取和删除用户账户,管理会话等。此外,该工具还支持HTTPS连接,并能验证远程服务支持的Redfish协议版本。
最低0.47元/天 解锁文章
2748





