0

I am working on a project to automate junos firewall policy creation workflow. I found pyEZ as the most viable option for my case.

Although I am able to retrieve the complete configuration from the device in xml format by using rpc.get_config() method. Unfortunately I don't see the default junos applications inside the retrieved xml file. But I can see them when running the commands manually on the device

show configuration groups junos-defaults applications | display set

set groups junos-defaults applications application junos-ftp application-protocol ftp

...

Please find the snippet below that am using currently to get the config

from jnpr.junos import Device from lxml import etree dev = Device(host='xxxx', user='demo', password='demo123', gather_facts=False) dev.open() cnf = dev.rpc.get_config() print etree.tostring(cnf) dev.close()

Please let me know if there is any such method available to get the default application group details.

Many thanks,

Prabir

Prabir
  • 11
  • 4

1 Answers1

2

check if this helps

dev.rpc.get_config(filter_xml='<groups><name>junos-defaults</name></groups>')

Nitin Kr
  • 521
  • 2
  • 12