Skip to content

Instantly share code, notes, and snippets.

@karmab
Created September 7, 2017 10:32
Show Gist options
  • Save karmab/6bc35f1a10089d5e15a03fff5e076f35 to your computer and use it in GitHub Desktop.
Save karmab/6bc35f1a10089d5e15a03fff5e076f35 to your computer and use it in GitHub Desktop.
import requests
host = "192.168.122.61"
port = "8443"
user = "admin"
password = "admin"
b = requests.session()
b.auth = (user, password)
b.verify = False
b.headers.update({'Content-Type':'application/json'})
results = b.get('https://%s:%s/mgmt/tm/ltm/pool' % (host, port))
for item in results.json()['items']:
print item['name']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment