-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from DMTF/Discovery-Tool
Added discover tool
- Loading branch information
Showing
3 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] ) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters