Hi,
I currently have code to fetch static and management routes via SOAP, and I’m tinkering with the rest API as an alternative. However I’m surprised to get:
[60] pry(main)> JSON.load(@transport.get (‘/mgmt/tm/net/route/’).body) => {“kind”=>“tm:net:route:routecollectionstate”, “selfLink”=>“https://localhost/mgmt/tm/net/route?ver=11.5.0 ”}
I can’t find anything else under net/ that seems appropriate. Is it just the case that some functionality is unavailable at this point in time?
JRahm
April 12, 2014, 10:55pm
2
in python, I get this:
>>>import requests.session()
>>>b = requests.session()
>>>b.auth('admin', 'admin')
>>>b.verify = False
>>>b.headers.update({'Content-Type': 'application/json'})
>>>b_url_base = 'https://192.168.6.5/mgmt/tm'
>>>routes = b.get('%s/net/route/' % b_url_base)
>>>print routes.text
{"kind":"tm:net:route:routecollectionstate","selfLink":"https://localhost/mgmt/tm/net/route?ver=11.5.0","items":[{"kind":"tm:net:route:routestate","name":"r1","partition":"Common","fullPath":"/Common/r1","generation":1,"selfLink":"https://localhost
/mgmt/tm/net/route/~Common~r1?ver=11.5.0","gw":"10.10.10.1","mtu":0,"network":"172.16.31.88/29"},{"kind":"tm:net:route:routestate","name":"r2","partition":"Common","fullPath":"/Common/r2","generation":1,"selfLink":"https://localhost/mgmt/tm/net/route
/~Common~r2?ver=11.5.0","gw":"10.10.10.1","mtu":0,"network":"192.32.32.0/24"},{"kind":"tm:net:route:routestate","name":"r.default","partition":"Common","fullPath":"/Common/r.default","generation":1,"selfLink":"https://localhost/mgmt/tm/net/route/~C
ommon~r.default?ver=11.5.0","gw":"10.10.10.1","mtu":0,"network":"default"}]}