Skip to content

Instantly share code, notes, and snippets.

@spiette
Last active December 26, 2015 22:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spiette/7221950 to your computer and use it in GitHub Desktop.
Save spiette/7221950 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import urllib2
import json
url = 'http://localhost:8080/v3/nodes'
r = urllib2.Request(url)
r.add_header('Accept', 'application/json')
u = urllib2.urlopen(r)
for i in sorted(json.load(u), key = lambda o: o['facts_timestamp']):
print( "%-24s %s" % ( i['name'], i['facts_timestamp']))
u.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment