Skip to content

Commit

Permalink
Merge pull request #28 from DMTF/Discovery-Tool
Browse files Browse the repository at this point in the history
Added discover tool
  • Loading branch information
mraineri authored Jan 16, 2020
2 parents 3127b39 + 1e679eb commit 07325ad
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,23 @@ You may install the external modules by running:
## Utilities


### Discover

```
usage: rf_discover.py [-h]
A tool to discover Redfish services
optional arguments:
-h, --help show this help message and exit
```

Example: `rf_discover.py`

The tool will perform an SSDP request to find all available Redfish services.
Once all of the responses are collected, it will print each service with its UUID and service root.


### Sensor List

```
Expand Down
28 changes: 28 additions & 0 deletions scripts/rf_discover.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#! /usr/bin/python
# Copyright Notice:
# Copyright 2020 DMTF. All rights reserved.
# License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/Redfish-Tacklebox/blob/master/LICENSE.md

"""
Redfish Discover
File : rf_discover.py
Brief : This script uses the redfish module to discover Redfish services
"""

import argparse
import redfish

# No arguments, but having help text is useful
argget = argparse.ArgumentParser( description = "A tool to discover Redfish services" )
args = argget.parse_args()

# Invoke the discovery routine for SSDP and print the responses
services = redfish.discover_ssdp()
if len( services ) == 0:
print( "No Redfish services discovered" )
else:
print( "Redfish services:" )
for service in services:
print( "{}: {}".format( service, services[service] ) )
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
scripts = [
"scripts/rf_accounts.py",
"scripts/rf_boot_override.py",
"scripts/rf_discover.py",
"scripts/rf_power_reset.py",
"scripts/rf_sensor_list.py",
"scripts/rf_sys_inventory.py",
Expand Down

0 comments on commit 07325ad

Please sign in to comment.