Skip to content

Instantly share code, notes, and snippets.

@tchellomello
Created September 21, 2016 20:35
Show Gist options
  • Save tchellomello/3dd376930f1d614e5f211e13d789509f to your computer and use it in GitHub Desktop.
Save tchellomello/3dd376930f1d614e5f211e13d789509f to your computer and use it in GitHub Desktop.
Archive pending actions
#!/usr/bin/python
import xmlrpclib
SATELLITE_URL = "http://orbital.usersys.redhat.com/rpc/api"
SATELLITE_LOGIN = "admin"
SATELLITE_PASSWORD = "redhat"
server = xmlrpclib.Server(SATELLITE_URL, verbose=0)
token = server.auth.login(SATELLITE_LOGIN, SATELLITE_PASSWORD)
#====================================================
in_progress = server.schedule.listInProgressActions(token)
for action in in_progress:
action_ids.append(action['id'])
print "%s action selected" % (len(action_ids))
archive_result=client.schedule.archiveActions(key,action_ids)
#====================================================
#logout
server.auth.logout(token)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment