A lightweight Redfish API command-line tool
Project description
🔧 redfishLiteApi
A lightweight command-line tool to interact with Redfish APIs using GET, POST, and PATCH methods. Designed for quick testing, debugging, and field extraction.
📦 Features
-
✅ Support for
GET,POST, andPATCH -
🔐 Basic Authentication (
-U/-P) -
🪪 Redfish Session Token support (
--session_token) -
🔑 Auto-login to get Redfish session token (
--login_session) -
📁 JSON body input via file (
--json_file) -
🔍 Recursive field value search with
--find(supports multiple fields) -
💾 Save response to file (
--save) -
🧾 Custom HTTP headers (
--header) -
🌐 Recursively fetch all linked resources (
--all) and save to folder (--file_name) -
⏱️ 10-second request timeout to prevent hanging
-
🧯 Disable SSL verification warnings
-
📡 HTTP Status display
-
⚠️ JSON parse error handling with fallback to raw text
-
🔢
--versionsupport -
🧭 Deep field path search across all linked resources (
--find_path)
🚀 Usage
python redfishLiteApi.py --url <API_URL> --method <get|post|patch> [OPTIONS]
🌐 Example: Recursively fetch all resources
python redfishLiteApi.py --url https://<host>/redfish/v1/Systems --method get --all --file_name dump_folder
🪪 Example: Use Redfish session token
python redfishLiteApi.py --url https://<host>/redfish/v1/Systems --method get --session_token <TOKEN>
🔑 Example: Auto-login to get session token
python redfishLiteApi.py --url https://<host>/redfish/v1/Systems --method get --login_session -U admin -P password
🧭 Example: Deep search for field path
python redfishLiteApi.py --url https://<host>/redfish/v1/ --method get -U admin -P password --find_path key
🧠 Argument Summary
Argument
Description
--url
Redfish API endpoint URL (required)
--method
HTTP method: get, post, or patch (required)
-U / --username
Basic auth username
-P / --password
Basic auth password
--json_file
Path to JSON file for POST or PATCH body
--find
One or more JSON field names to recursively extract (GET only)
--find_path
Find and print the value and API path of specific field(s) recursively across all linked resources (GET only)
--save
Save the response body to a file
--header
Custom headers in Key:Value format (can be repeated)
--session_token
Use existing Redfish session token for authentication
--login_session
Automatically login and get Redfish session token
--all
Recursively follow @odata.id and save all data into folders
--file_name
Folder name to save files when using --all
--version
Show current version and exit
⚠️ Notes
-
SSL certificate verification is disabled (
verify=False). -
Timeout is hardcoded to 10 seconds.
-
HTTP error handling is basic — be sure to inspect the response if you encounter unexpected results.
🛠 Dependencies
-
Python 3.x
-
requests
Install dependencies via:
pip install -r requirements.txt
requirements.txt content:
requests
📜 License
MIT License
📬 Contact
For questions, feature requests, or business inquiries, please contact:
Jeffery Lin
📧 jeffery12240122@gmail.com
Or open an issue on GitHub.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file redfishliteapi-1.2.0.tar.gz.
File metadata
- Download URL: redfishliteapi-1.2.0.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9023fcfcb035412f5feabb07c0ae9f9e84bac590e720972238edd282ca5d2cd5
|
|
| MD5 |
f3810ff8367420339f85ad370edee6fd
|
|
| BLAKE2b-256 |
f394f78cfae52bb62d5414ccd6f8a3b785366e688c6b33e63b575322fff03197
|
File details
Details for the file redfishliteapi-1.2.0-py3-none-any.whl.
File metadata
- Download URL: redfishliteapi-1.2.0-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f100921b4bc5251e6000d4630bb1c8d9b100fc94838c0397b9c852ccc6446762
|
|
| MD5 |
5108d1014f0c969fdffe5ff5072af062
|
|
| BLAKE2b-256 |
fc3370f67d750d0a3ae87078e65a4a9d69ed0032df8a9eb63d12ce21ca9d7cf0
|