Created
December 15, 2017 11:17
-
-
Save moio/2369fad0babdeb85b1a21af06386c497 to your computer and use it in GitHub Desktop.
Sample SUSE Manager XMLRPC script to get details about a system
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
#!/usr/bin/python | |
import sys | |
import xmlrpclib | |
if len(sys.argv) != 5: | |
print("Usage: getdetails.py <SUSE MANAGER HOSTNAME> <USERNAME> <PASSWORD> <SYSTEM ID>") | |
sys.exit(1) | |
manager_url = "http://" + sys.argv[1] + "/rpc/api" | |
client = xmlrpclib.Server(manager_url, verbose=0) | |
session_key = client.auth.login(sys.argv[2], sys.argv[3]) | |
details = client.system.getDetails(session_key, int(sys.argv[4])) | |
print(details) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment