红鱼公用事业
redfish-utilities的Python项目详细描述
红鱼图钉板
版权所有2019 DMTF。保留所有权利。
关于
redfish tacklebox包含一组python实用程序,用于对redfish服务执行常见的管理操作。 这些实用程序可以用作更大的管理应用程序的一部分,也可以用作独立的命令行工具。
安装
pip安装redfish实用程序
从源头建设
python setup.py sdist --formats=zip
cd dist
pip install redfish_utilities-x.x.x.zip
要求
外部模块:
- 红鱼:https://pypi.python.org/pypi/redfish rel="nofollow">https://pypi.python.org/pypi/redfish
您可以通过运行以下命令安装外部模块:
pip install-r requirements.txt
实用程序
传感器列表
usage: rf_sensor_list.py [-h] --user USER --password PASSWORD --rhost RHOST
A tool to walk a Redfish service and list sensor info
required arguments:
--user USER, -u USER The user name for authentication
--password PASSWORD, -p PASSWORD
The password for authentication
--rhost RHOST, -r RHOST
The address of the Redfish service (with scheme)
optional arguments:
-h, --help show this help message and exit
示例:rf_sensor_list.py-u root-p root-r https://192.168.1.100
该工具将使用用户和密码参数提供的凭据登录到rhost参数指定的服务。 然后,它遍历服务的机箱集合,并读取它们各自的电源和热量资源。 利用这些资源中的信息,它将构建一个传感器表并打印收集的信息。
系统库存
usage: rf_sys_inventory.py [-h] --user USER --password PASSWORD --rhost RHOST
[--details] [--noabsent]
A tool to walk a Redfish service and list component information
required arguments:
--user USER, -u USER The user name for authentication
--password PASSWORD, -p PASSWORD
The password for authentication
--rhost RHOST, -r RHOST
The address of the Redfish service (with scheme)
optional arguments:
-h, --help show this help message and exit
--details, -details Indicates if the full details of each component should
be shown
--noabsent, -noabsent
Indicates if absent devices should be skipped
示例:rf_sys_inventory.py-u root-p root-r https://192.168.1.100-详细信息
该工具将使用用户和密码参数提供的凭据登录到rhost参数指定的服务。 然后,它遍历服务的机箱集合,并收集处理器、内存、驱动器、PCIEdevices、网络适配器和存储控制器的组件信息。 使用收集的信息,它将建立一个库存表并打印信息。
电源/复位
usage: rf_power_reset.py [-h] --user USER --password PASSWORD --rhost RHOST
[--system SYSTEM] [--type TYPE]
A tool to perform a power/reset operation of a system
required arguments:
--user USER, -u USER The user name for authentication
--password PASSWORD, -p PASSWORD
The password for authentication
--rhost RHOST, -r RHOST
The address of the Redfish service (with scheme)
optional arguments:
-h, --help show this help message and exit
--system SYSTEM, -s SYSTEM
The ID of the system perform the operation
--type TYPE, -t TYPE The type of power/reset operation to perform
示例:rf_power_reset.py-u root-p root-r https://192.168.1.100-t gracefulrestart
该工具将使用用户和密码参数提供的凭据登录到rhost参数指定的服务。 然后,它遍历服务的系统集合,以找到由system参数指定的匹配系统。 它将使用type参数中指定的重置类型执行重置操作。
- 如果未指定系统,并且服务只有一个系统,则它将在一个系统上执行操作。
- 如果未指定类型,它将尝试正常重新启动。
启动覆盖
usage: rf_boot_override.py [-h] --user USER --password PASSWORD --rhost RHOST
[--system SYSTEM] [--target TARGET] [--uefi UEFI]
[--reset]
A tool to perform a one time boot override of a system
required arguments:
--user USER, -u USER The user name for authentication
--password PASSWORD, -p PASSWORD
The password for authentication
--rhost RHOST, -r RHOST
The address of the Redfish service (with scheme)
optional arguments:
-h, --help show this help message and exit
--system SYSTEM, -s SYSTEM
The ID of the system to set
--target TARGET, -t TARGET
The target boot device; if not provided the tool will
display the current boot settings
--uefi UEFI, -uefi UEFI
If target is 'UefiTarget', the UEFI Device Path of the
device to boot. If target is 'UefiBootNext', the UEFI
Boot Option string of the device to boot.
--reset, -reset Signifies that the system is reset after the boot
override is set
示例: 该工具将使用用户和密码参数提供的凭据登录到rhost参数指定的服务。
然后,它遍历服务的系统集合,以找到由system参数指定的匹配系统。 然后,该工具将对匹配系统中的引导对象执行操作。 该工具将使用用户和密码参数提供的凭据登录到rhost参数指定的服务。
根据参数,它将显示、添加、删除或修改用户帐户。 示例: 该工具将使用用户和密码参数提供的凭据登录到rhost参数指定的服务。
然后,它构建一个请求负载,使用image参数指定的映像对更新服务执行一个简单的更新操作。
如果尝试更新特定的系统、设备、管理器或其他资源,则在请求中使用可选的target参数。
请求简单更新后,它将监视更新的进度,并在更新完成后显示服务报告的有关更新的响应消息。rf_boot_override.py-u root-p root-r https://192.168.1.100-t pxe-reset
帐户
usage: rf_accounts.py [-h] --user USER --password PASSWORD --rhost RHOST
[--add name password role] [--delete DELETE]
[--setname old_name new_name]
[--setpassword name new_password]
[--setrole name new_role] [--enable ENABLE]
[--disable DISABLE] [--unlock UNLOCK]
A tool to manage user accounts on a Redfish service
required arguments:
--user USER, -u USER The user name for authentication
--password PASSWORD, -p PASSWORD
The password for authentication
--rhost RHOST, -r RHOST
The address of the Redfish service (with scheme)
optional arguments:
-h, --help show this help message and exit
--add name password role, -add name password role
Adds a new user account
--delete DELETE, -delete DELETE
Deletes a user account with the given name
--setname old_name new_name, -setname old_name new_name
Sets a user account to a new name
--setpassword name new_password, -setpassword name new_password
Sets a user account to a new password
--setrole name new_role, -setrole name new_role
Sets a user account to a new role
--enable ENABLE, -enable ENABLE
Enables a user account with the given name
--disable DISABLE, -disable DISABLE
Disabled a user account with the given name
--unlock UNLOCK, -unlock UNLOCK
Unlocks a user account with the given name
rf_acounts.py-u root-p root-r https://192.168.1.100-添加新名称新密码新角色
rf_accounts.py-u root-p root-r https://192.168.1.100-delete user_to_delete
rf_accounts.py-u root-p root-r https://192.168.1.100-setname user_to_change new_name
rf_accounts.py-u root-p root-r https://192.168.1.100-setpassword user_to_change new_password
rf_accounts.py-u root-p root-r https://192.168.1.100-setrole user_to_change new_role
rf_accounts.py-u root-p root-r https://192.168.1.100-启用用户更改
rf_accounts.py-u root-p root-r https://192.168.1.100-禁用用户更改
rf_accounts.py-u root-p root-r https://192.168.1.100-unlock user_to_change
rf_accounts.py-u root-p root-r https://192.168.1.100
更新
usage: rf_update.py [-h] --user USER --password PASSWORD --rhost RHOST --image
IMAGE [--target TARGET]
A tool to perform an update with a Redfish service
required arguments:
--user USER, -u USER The user name for authentication
--password PASSWORD, -p PASSWORD
The password for authentication
--rhost RHOST, -r RHOST
The address of the Redfish service (with scheme)
--image IMAGE, -i IMAGE
The URI or filepath of the image
optional arguments:
-h, --help show this help message and exit
--target TARGET, -t TARGET
The target resource to apply the image
rf_update.py-u root-p root-r https://192.168.1.100-i image.bin
释放过程
python setup.py sdist
捆绳上传距离/*
推荐PyPI第三方库