ksator / junos_automation_with_rest_calls Goto Github PK
View Code? Open in Web Editor NEWHow to make rest calls to Junos
License: MIT License
How to make rest calls to Junos
License: MIT License
Thank you for this explanatory guide on using the JUNOS REST API.
Would you be so kind to explain how to enable a boolean argument when making a query ?
For example,
In [5]: requests.get("http://127.0.0.1:10001/rpc/get-route-information?table=inet.0&receive-protocol-name=bgp&peer=x.x.x.x&destination=1.1.1.1&extensive", verify=False, auth=("xxx", "xxx"), headers={"host": "glass.junos.ip-spotlight.xxx.xxx", "accept": "application/json"}).json()
Out[5]:
{'route-information': [{'route-table': [{'table-name': [{'data': 'inet.0'}],
'destination-count': [{'data': '864074'}],
'total-route-count': [{'data': '10546835'}],
'active-route-count': [{'data': '864074'}],
'holddown-route-count': [{'data': '0'}],
'hidden-route-count': [{'data': '0'}],
'rt': [{'attributes': {'junos:style': 'bgp-brief'},
'rt-destination': [{'data': '1.1.1.0/24'}],
'rt-entry': [{'active-tag': [{}],
'protocol-name': [{'data': 'BGP'}],
'med': [{'data': '0'}],
'local-preference': [{'data': '250'}],
'as-path': [{'data': '3356 13335 I'}],
'nh': [{'to': [{'data': 'x.x.x.x'}]}]}]}]}]}]}
No matter if I pass &extensive
the output states {'junos:style': 'bgp-brief'}
How to enable the extensive
version of a command output, in the above case to get the BGP communities for example ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.