Created
November 1, 2012 19:31
-
-
Save EdLeafe/3995892 to your computer and use it in GitHub Desktop.
Sample usage script
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/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