django-orchestra-test/orchestra/getips.py

16 lines
359 B
Python
Raw Normal View History

2015-09-18 11:29:52 +00:00
#! /usr/bin/env python
import requests
import json
SLICE_ID=1513
slice_req = requests.get('https://controller.community-lab.net/api/slices/%i' % SLICE_ID)
slice = json.loads(slice_req.content)
for sliver in slice['slivers']:
sliver_req = requests.get(sliver['uri'])
sliver = json.loads(sliver_req.content)
print sliver['mgmt_net']['address']