Skip to content
Snippets Groups Projects
Commit d2f63d92 authored by Erik Reid's avatar Erik Reid
Browse files

added --netconf-only option

parent b71b548c
No related branches found
No related tags found
No related merge requests found
...@@ -6,6 +6,7 @@ import socket ...@@ -6,6 +6,7 @@ import socket
import click import click
import jsonschema import jsonschema
from lxml import etree
from brian_polling_manager.interface_stats import config, brian, errors, juniper from brian_polling_manager.interface_stats import config, brian, errors, juniper
from brian_polling_manager import influx, inventory from brian_polling_manager import influx, inventory
...@@ -207,7 +208,15 @@ def _main(router_fqdn: str, app_config_params: dict): ...@@ -207,7 +208,15 @@ def _main(router_fqdn: str, app_config_params: dict):
type=click.STRING, type=click.STRING,
help='router fqdn', help='router fqdn',
callback=_validate_hostname) callback=_validate_hostname)
def main(router_fqdn, app_config_params: dict): @click.option(
'--netconf-only/--no-netconf-only', 'netconf_only',
default=False,
type=click.BOOL,
help='just run the netconf query and output the simplified xml, then exit')
def main(router_fqdn: str, app_config_params: dict, netconf_only: bool):
if netconf_only:
_doc = juniper.get_interface_info_ncrpc(router_fqdn)
print(etree.tostring(_doc, pretty_print=True))
_main(router_fqdn, app_config_params) _main(router_fqdn, app_config_params)
......
{
"ssh-config": "~/.ssh/config.d/routers-jump",
"inventory": ["http://blah"],
"influx": {
"brian-counters": {
"hostname": "hostname",
"database": "dbname",
"measurement": "brian",
"username": "some-username",
"password": "user-password"
},
"error-counters": {
"hostname": "hostname",
"database": "dbname",
"measurement": "errors",
"username": "some-username",
"password": "user-password"
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment