Created
February 20, 2017 18:03
-
-
Save pgriess/0f8c6389d4be43b20f058ab3d3831197 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
def aws4_signature_parts(...): | |
... | |
def aws_route53(aws_key, aws_key_secret, path, data=None): | |
url = 'https://route53.amazonaws.com/2013-04-01/{}'.format(path) | |
_, _, headers = aws4_signature_parts( | |
aws_key, | |
aws_key_secret, | |
'GET' if data is None else 'POST', | |
url, | |
data='' if data is None else data) | |
return urllib2.urlopen(urllib2.Request(url, headers=headers, data=data)) | |
print aws_route53(aws_key, aws_secret, 'hostedzone').read() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment