Skip to content

Instantly share code, notes, and snippets.

@EdLeafe
Created November 1, 2012 19:31
Show Gist options
  • Save EdLeafe/3995892 to your computer and use it in GitHub Desktop.
Save EdLeafe/3995892 to your computer and use it in GitHub Desktop.
Sample usage script
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
import os
import pyrax
creds_file = os.path.expanduser("~/.rackspace_cloud_credentials")
pyrax.set_credential_file(creds_file)
clb = pyrax.cloud_loadbalancers
start = datetime.datetime.now() - datetime.timedelta(hours=12)
end = start + datetime.timedelta(hours=6)
usage = clb.get_usage(startTime=start, endTime=end)
print usage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment