Openstack Firewall Rules

**I've been spending time with Openstack.** **I've written some Python to list Openstack firewall rules:**

import requests
import json
__author__ = 'milesd'

from os import environ as env
import keystoneclient.v2_0.client as ksclient

keystone = ksclient.Client(auth_url=env['OS_AUTH_URL'],
                           username=env['OS_USERNAME'],
                           password=env['OS_PASSWORD'],
                           tenant_name=env['OS_TENANT_NAME'],
                           region_name=env['OS_REGION_NAME'])

token = keystone.auth_token
url = 'https://compute.datacentred.io:9696/v2.0/fw/firewall_rules'
headers = {'X-Auth-Token': token}

r = requests.get(url, headers=headers)

parsed_json = json.loads(r.content)

print parsed_json

parsed_json is a dictionary of firewall rules

Author | Miles Davenport

Career programmer, who designs, assembles, fixes, and supports customers, software and systems.