Skip to content

Instantly share code, notes, and snippets.

@ozgurakan
Last active April 13, 2017 01:25
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 ozgurakan/2c634f176720bbdee11e71c85469e772 to your computer and use it in GitHub Desktop.
Save ozgurakan/2c634f176720bbdee11e71c85469e772 to your computer and use it in GitHub Desktop.
json example
#!/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