Query multiple datasets in export template #9468
Unanswered
Decafpancakes
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Export templates are intended to work primarily with a single type of object. For more complex queries, you're likely better off writing a custom report to generate the exact data you need. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have been messing around with the export template and i have 2 templates. one to export the VLANS and one to export the IPAddresses. What I'm trying to do is combine the two so that IPs within the particular VLAN prefix are exported with the VLAN config. I thought this might be possible by getting the prefix for the VLAN then getting the child ips within it but so far I cant figure out how to reference it. Both of these exports work great independently, just not together. So far this is the export code:
IP:
{% for IPAddress in queryset %}
Desc: , Location:
host {{ IPAddress.dns_name}} { hardware ethernet {{ IPAddress.cf.mac_address }}; fixed-address {{ IPAddress.address }}; }
{% endfor %}
VLAN:
{% for vlan in queryset %}
VLAN {{vlan.vid}}
#$ {{vlan.cf.domain_name}}
subnet {{vlan.cf.vlan_prefix}} {{vlan.cf.subnet_mask}}
{
authoritative;
allow unknown-clients;
option domain-name-servers {{vlan.cf.domain_name_servers}};
option routers {{vlan.cf.routers}};
option domain-name "{{vlan.cf.domain_name}}";
option time-offset {{vlan.cf.time_offset}};
option broadcast-address {{vlan.cf.broadcast_address}};
option subnet-mask {{vlan.cf.subnet_mask}};
option slp-directory-agent true {{vlan.cf.slp_directory_agent}};
option slp-service-scope true {{vlan.cf.slp_service_scope}};
option netbios-name-servers {{vlan.cf.netbios_name_servers}};
option netbios-dd-server {{vlan.cf.netbios_dd_server}};
option netbios-node-type {{vlan.cf.netbios_node_type}};
}
{% endfor %}
Beta Was this translation helpful? Give feedback.
All reactions