Closed chdxD1 closed 1 week ago
I was finally able to start working on this. Just created WIP PR.
For now there are 3 GET endpoints.
Endpoint /show/route:
Example: /show/route?protocol=<ip/ipv6>&vrf=\<vrf>
Can you tell me what <input>
is and how to switch between with/without longer-prefixes
. Or point me to the docs, as I can't find this.
Endpoint: /show/bgp
Example: /show/bgp?vrf=\<vrf>&protocol=\<ipv4/ipv6>
Same question about <input>
and prefixes applies here. Also, will
show bgp vrf all ipv4/ipv6 unicast \<input> json
be a valid command?
|> Example: /show/bgp?vrf=\<vrf>&type=summary
Endpoint /show/evpn:
Example: /show/evpn
Example: /show/evpn?type=rmac&vrf=\<vrf>
Example: Example: /show/evpn?type=mac&vrf=\<vrf>
Example: Example: /show/evpn?type=next-hops&vrf=\<vrf>
@p-strusiewiczsurmacki-mobica <input>
will be a CIDR in the form of <IP>/<length>
e.g. 192.168.0.0/16
, 0.0.0.0/0
, 2a01::/64
(for IPv6). To switch between longer-prefixes mode prepend json
with longer-prefixes
--> show ip route vrf Vrf_test 192.168.0.0/16 longer-prefixes json
It would be good to sanitise the values, input should be parsed through net.ParseCIDR
.
Example: /show/route?protocol=<ip/ipv6>&vrf=
&cidr/input= &longer_prefixes=true/false
@chdxD1 OK, I've made changes you've requested (I hope it'll be OK now). I've also added global endpoints:
If any pod will be queried with those it will pass those requests to all the network operator pods and will return response in form of:
"hostname1": {json response}
"hostname2": {json response}
I don't really have setup to fully test this using frr, but I'll try to check if this works when queried using a service, and I'll also try to add some unit tests.
@p-strusiewiczsurmacki-mobica I've commented on the MR 1) Probably it is better to use services for discovery 2) It would be nice to get JSON for the global endpoints as well (see my idea in MR)
I'll try it out soon
@chdxD1 - services are now used for discovery. See my comment in the PR for more details. JSON output should be handled as well.
@chdxD1 @p-strusiewiczsurmacki-mobica maybe we should close this as #100 is merged.
As of today we have to connect to all nodes one-by-one, open
vtysh
and run debug commands. This is a rather tedious process.I'd like to propose an API endpoint on each of the monitoring containers (where it is probably best suited because we already have a vtysh connection and methods around querying it) that gathers this information on each node.
In addition to that there should be another endpoint that allows retrieving information from all nodes in a cluster by querying just one network-operator pod, this could be achieved by using Kubernetes service or pod discovery.
List of commands that should be implemented (all output can be returned as is, without any sanitization):
show ip/ipv6 route (vrf <vrf>) <input> json
(with/without longer-prefixes)show bgp (vrf <vrf>) ipv4/ipv6 unicast <input> json
(with/without longer-prefixes)show evpn vni json
show evpn rmac vni <all|vrf> json
show evpn mac vni <all|vrf> json
show evpn next-hops vni <all|vrf> json
show bgp vrf <all|vrf> summary json