Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@nicholaskuechler
Created July 24, 2012 15:29
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 nicholaskuechler/3170669 to your computer and use it in GitHub Desktop.
Save nicholaskuechler/3170669 to your computer and use it in GitHub Desktop.
Slicehost - list slice bandwidth in / bandwidth out
from pyactiveresource.activeresource import ActiveResource
api_password = 'YOUR_API_KEY_GOES_HERE'
api_site = 'https://%s@api.slicehost.com/' % api_password
class Slice(ActiveResource):
_site = api_site
class Zone(ActiveResource):
_site = api_site
class Record(ActiveResource):
_site = api_site
slices = Slice.find()
for slice in slices:
print "ID: %d name: %s B/W In: %s B/W Out: %s" % (slice.id, slice.name, slice.bw_in, slice.bw_out)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment