Closed KincaidYang closed 3 months ago
Yes, see these two pages:
https://v2.hyperglass.dev/configuration/directives
https://v2.hyperglass.dev/configuration/examples/add-your-own-command
It is possible you could filter the default directives to specific ones with something like:
devices:
- name: Name
directives:
- __hyperglass_juniper_bgp_route__
- __hyperglass_juniper_traceroute__
I'm not 100% sure if that would work, I'll need to test it later. You can look here for all the built-in directives and their IDs.
They don't seem to be working properly. When I configure them like this, all query types are still being built:
devices:
- name: Amsterdam, NL
address: 78.142.xxx.xxx
platform: bird
credential:
username: bird
password: xxxxxxxxxxxxxxxxxxxxxxxxx
attrs:
source4: 0.0.0.0
source6: ::0
directives:
- __hyperglass_bird_bgp_route__
- __hyperglass_bird_traceroute__
So I tried adding the parameter builtins: false
, but after that, it didn't support any query type:
devices:
- name: Amsterdam, NL
address: 78.142.xxx.xxx
platform: bird
credential:
username: bird
password: xxxxxxxxxxxxxxxxxxxxxxxxx
attrs:
source4: 0.0.0.0
source6: ::0
directives:
- builtins: false
- __hyperglass_bird_traceroute__
- __hyperglass_bird_bgp_route__
Ok. That was a guess, and I'm not surprised it didn't work. I will devise a way to selectively enable/disable built-in directives. In the mean time, you'll probably need to add your own custom directives.
After looking at this in depth, this does already exist, this is how you do it:
devices:
- name: Amsterdam, NL
address: 78.142.xxx.xxx
platform: bird
credential:
username: bird
password: xxxxxxxxxxxxxxxxxxxxxxxxx
attrs:
source4: 0.0.0.0
source6: ::0
directives:
- builtins: [traceroute, bgp_route] # no need to specify the full name of the directive
I'll update the docs.
Hi @thatmattlove , Does
v2.0.0
support configuring specific query types? For instance, I only wish to supportBGP Route
andTraceroute
. I couldn't find any relevant documentation on this, and attempting to use the parameters fromv1.0.4
did not work.