Last active
April 13, 2017 01:25
-
-
Save ozgurakan/2c634f176720bbdee11e71c85469e772 to your computer and use it in GitHub Desktop.
json example
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
#!/bin/python3 | |
# | |
# Related API | |
# http://docs.aws.amazon.com/cli/latest/reference/elb/describe-load-balancer-attributes.html | |
# | |
import json | |
json_doc = '''{ | |
"Attributes": [ | |
{ | |
"Value": "false", | |
"Key": "access_logs.s3.enabled" | |
}, | |
{ | |
"Value": "60", | |
"Key": "idle_timeout.timeout_seconds" | |
}, | |
{ | |
"Value": "", | |
"Key": "access_logs.s3.prefix" | |
}, | |
{ | |
"Value": "false", | |
"Key": "deletion_protection.enabled" | |
}, | |
{ | |
"Value": "", | |
"Key": "access_logs.s3.bucket" | |
} | |
] | |
}''' | |
my_dict = json.loads(json_doc) | |
attributes = my_dict['Attributes'] | |
for attribute in attributes: | |
print("'{}' -> '{}'".format(attribute['Key'], attribute['Value'])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment