Open Kilda Java Documentation
get_links.py
Go to the documentation of this file.
1 """
2 get_links.py - get all the links
3 
4 The path is NB -> TER -> NEO4J.
5 """
6 import requests
7 from base64 import b64encode
8 
9 url = "http://localhost:8088/api/v1/links"
10 headers = {
11  'Content-Type': 'application/json',
12  'Authorization': 'Basic %s' % b64encode(b"kilda:kilda").decode("ascii")
13 }
14 
15 #
16 # This models one of the first flows used by ATDD. It sends the request to teh NB API so that
17 # kilda will construct the flow path rules.
18 # TODO: would be better to pull from the same data, ensure code bases on synchronized..
19 # at the moment, this is hardcoded here, and ATDD has a separate source.
20 #
21 
22 result = requests.get(url, headers=headers)
23 
24 print result.status_code
25 print result.text
26 
27