Overview:
redfishtool is a CLI tool that for OA&M engineer as the client side of the Redfish RESTful API for Data Center Hardware Management. Redfish is the latest RESTful API for hardware management defined by the DMTF (Distributed Management Task Force).
Purpose:
This article introduces how to install the redfishtool on Windows 10.
Target Audience:
For those engineer(s) whom will use redfish client redfishtool to management the redfish supported hardware. Then engineer(s) shall understand the redfish API and how to run the text command under Windows 10 PowerShell.
Pre-requirement:
1. Windows 10 with the latest security update.
2. Install the python3 on Windows 10. Please click How to install python3 and pip on Windows 10?
3. Option: if you prefer to run the redfishtool in a python virtualenv. Please click How to install VirtualEnv & Activate of python3 on Windows 10? This is not mandatory. Just for those whom want to isolate the environment with other python project(s).
Procedures:
In this article, we are using the python virtualenv to install redfishtool and run it. You can by pass the virtualenv portion if you do not want to do it in virtualenv).
Installation:
redfishtool is based on Python 3 and the client system is required to have the Python framework installed before the tool can be installed and executed on the system.
There are couple ways to install redfishtool. In this article, we only use the pip installation.
Option: python virtualenv [venv]
In this article, we use redfish as [venv]
# Activate the virtualenv redfish
PS C:\Users\[username]> redfish\Scripts\activate
(redfish) PS C:\Users\[username]>
# Install redfishtool in virtualenv
(redfish) PS C:\Users\[username]> pip install redfishtool
# or install redfishtool not in virtualenv
PS C:\Users\[username]> pip install redfishtool
Collecting redfishtool
Downloading redfishtool-1.1.5.tar.gz (83 kB)
|████████████████████████████████| 83 kB 402 kB/s
Collecting python-dateutil
Downloading python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB)
|████████████████████████████████| 227 kB 6.4 MB/s
Collecting requests
Downloading requests-2.25.1-py2.py3-none-any.whl (61 kB)
|████████████████████████████████| 61 kB 1.9 MB/s
Collecting six>=1.5
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting urllib3<1.27,>=1.21.1
Downloading urllib3-1.26.6-py2.py3-none-any.whl (138 kB)
|████████████████████████████████| 138 kB 1.3 MB/s
Collecting chardet<5,>=3.0.2
Downloading chardet-4.0.0-py2.py3-none-any.whl (178 kB)
|████████████████████████████████| 178 kB 1.7 MB/s
Collecting certifi>=2017.4.17
Downloading certifi-2021.5.30-py2.py3-none-any.whl (145 kB)
|████████████████████████████████| 145 kB 6.4 MB/s
Collecting idna<3,>=2.5
Downloading idna-2.10-py2.py3-none-any.whl (58 kB)
|████████████████████████████████| 58 kB 1.7 MB/s
Building wheels for collected packages: redfishtool
Building wheel for redfishtool (setup.py) ... done
Created wheel for redfishtool: filename=redfishtool-1.1.5-py3-none-any.whl size=75839 sha256=ae69dbb9ced8dd4122605e24f0eb316b9d5f67da75207368167f888d90d846a4
Stored in directory: c:\users\ch.huang789\appdata\local\pip\cache\wheels\ea\83\18\684ae7f68442bb38aa9d0dc295235f2098fd8cc8bf4893d77b
Successfully built redfishtool
Installing collected packages: urllib3, six, idna, chardet, certifi, requests, python-dateutil, redfishtool
Successfully installed certifi-2021.5.30 chardet-4.0.0 idna-2.10 python-dateutil-2.8.1 redfishtool-1.1.5 requests-2.25.1 six-1.16.0 urllib3-1.26.6
WARNING: You are using pip version 21.1.2; however, version 21.1.3 is available.
You should consider upgrading via the 'C:\Users\[username]\redfish\Scripts\python.exe -m pip install --upgrade pip' command.
# Upgrade the pip
(redfish) PS C:\Users\[username]> C:\Users\[username]\redfish\Scripts\python.exe -m pip install --upgrade pip
Requirement already satisfied: pip in c:\users\[username]\redfish\lib\site-packages (21.1.2)
Collecting pip
Using cached pip-21.1.3-py3-none-any.whl (1.5 MB)
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 21.1.2
Uninstalling pip-21.1.2:
Successfully uninstalled pip-21.1.2
Successfully installed pip-21.1.3
# Check the pip version
(redfish) PS C:\Users\[username]> pip -V
pip 21.1.3 from c:\users\[username]\redfish\lib\site-packages\pip (python 3.9)
Test:
1. Test root without UserName and Password:
(redfish) PS C:\Users\[username]> python redfish\scripts\redfishtool -r 172.17.21.120 root
{
"@odata.type": "#ServiceRoot.v1_0_0.ServiceRoot",
"@odata.context": "/redfish/v1/$metadata/ServiceRoot.ServiceRoot",
"@odata.id": "/redfish/v1",
"@odata.etag": "W/\"3f1cf64f3c66670a\"",
"Id": "RootService",
"Name": "Root Service",
"RedfishVersion": "1.3.1",
"OData": {
"@odata.type": "#OData.v1_0_0.OData",
"@odata.context": "/redfish/v1/$metadata/ServiceRoot.OData",
"@odata.id": "/redfish/v1/odata",
"@odata.etag": "W/\"3f1cf64f3c66670a\""
},
"SessionService": {
"@odata.type": "#SessionService.v1_0_0.SessionService",
"@odata.context": "/redfish/v1/$metadata/ServiceRoot.SessionService",
"@odata.id": "/redfish/v1/SessionService",
"@odata.etag": "W/\"3f1cf64f3c66670a\""
},
"AccountService": {
"@odata.type": "#AccountService.v1_1_0.AccountService",
"@odata.context": "/redfish/v1/$metadata/ServiceRoot.AccountService",
"@odata.id": "/redfish/v1/AccountService",
"@odata.etag": "W/\"3f1cf64f3c66670a\""
},
"EventService": {
"@odata.type": "#EventService.v1_0_0.EventService",
"@odata.context": "/redfish/v1/$metadata/ServiceRoot.EventService",
"@odata.id": "/redfish/v1/EventService",
"@odata.etag": "W/\"3f1cf64f3c66670a\""
},
"Systems": {
"@odata.type": "#ComputerSystemCollection.ComputerSystemCollection",
"@odata.context": "/redfish/v1/$metadata/ServiceRoot.Systems",
"@odata.id": "/redfish/v1/Systems",
"@odata.etag": "W/\"3f1cf64f3c66670a\""
},
"Chassis": {
"@odata.type": "#ChassisCollection.ChassisCollection",
"@odata.context": "/redfish/v1/$metadata/ServiceRoot.Chassis",
"@odata.id": "/redfish/v1/Chassis",
"@odata.etag": "W/\"3f1cf64f3c66670a\""
},
"Managers": {
"@odata.type": "#ManagerCollection.ManagerCollection",
"@odata.context": "/redfish/v1/$metadata/ServiceRoot.Managers",
"@odata.id": "/redfish/v1/Managers",
"@odata.etag": "W/\"3f1cf64f3c66670a\""
},
"Links": {
"Sessions": {
"@odata.id": "/redfish/v1/SessionService/Sessions"
}
}
}
2. Test odata with UserName and Password:
(redfish) PS C:\Users\[username]> python redfish\scripts\redfishtool -r 172.17.21.120 -u administrator -p advantech odata
{
"@odata.context": "/redfish/v1/$metadata",
"value": [
{
"name": "ServiceRoot",
"kind": "EntitySet",
"url": "/redfish/v1"
},
{
"name": "OData",
"kind": "Singleton",
"url": "/redfish/v1/odata"
},
{
"name": "$metadata",
"kind": "Singleton",
"url": "/redfish/v1/$metadata"
},
{
"name": "SessionService",
"kind": "Singleton",
"url": "/redfish/v1/SessionService"
},
{
"name": "AccountService",
"kind": "Singleton",
"url": "/redfish/v1/AccountService"
},
{
"name": "EventService",
"kind": "Singleton",
"url": "/redfish/v1/EventService"
},
{
"name": "Systems",
"kind": "Singleton",
"url": "/redfish/v1/Systems"
},
{
"name": "Chassis",
"kind": "Singleton",
"url": "/redfish/v1/Chassis"
},
{
"name": "Managers",
"kind": "Singleton",
"url": "/redfish/v1/Managers"
}
]
}
3. Test Systems/0 with UserName and Password for Always secure:
(redfish) PS C:\Users\[username]> python redfish\scripts\redfishtool -r 172.17.21.120 -u administrator -p advantech -S Always Systems -i 0
{
"@odata.type": "#ComputerSystemCollection.ComputerSystemCollection",
"@odata.context": "/redfish/v1/$metadata/ComputerSystemCollection.ComputerSystemCollection",
"@odata.id": "/redfish/v1/Systems",
"@odata.etag": "W/\"9f5401831e54a31e\"",
"Name": "System Collection",
"Members@odata.count": 1,
"Members": [
{
"@odata.id": "/redfish/v1/Systems/0"
}
]
}
For more detail about how to use redfishtool, please refer the the following official github site:
https://github.com/DMTF/Redfishtool
--- End of this article ---
Comments
0 comments
Please sign in to leave a comment.