What is the error? Did you define the table in-line or is it in a separate file? If it's the latter, did you create the YAML formatter/converter? Did you import it? If it's the former, is the T&V defined globally?
A lot of different ways to do this, so need to see ALL of the code after you share the error.
Edward Arcuri Architect - Automation & Programmability, JDI
If you want to get DNS ALG status with PyEZ Tables, this is possible by slightly modifying your script as follows:
from jnpr.junos import Device
from jnpr.junos.factory.factory_loader import FactoryLoader
yaml_data = """
dev = Device(host='172.20.1.201', user='root', password='Password', gather_facts=False)
ags = AlgTable(dev)
for ag in ags:
'dns: ', ag.DNS)
However I would say this is not the best use of Tables/Views. The main use case for Tables/Views is when you have several items with same XML tag, such as many interfaces or routes. In this case we just have only one alg-dns-status element in any case, so it is easier to just call the rpc and parse the response: