示例#1
0
 def create_vrf(self):
     """
     Create a DnsVrf and configure it
     """
     vrf = DnsVrf('test_vrf1')
     vrf.set_profile('test_profile')
     
     dns_provider = DnsProvider('1.1.1.1')
     dns_domain = DnsDom('name')
     dns_dmn_ext = DnsDomExt('name1')
     
     vrf.use_in(dns_provider)
     vrf.use_in(dns_domain)
     vrf.use_in(dns_dmn_ext)
     
     return vrf
示例#2
0
 def create_dns(self):
     """
     Create a DNS object and add other typr of dns objects
     """
     dns = DNS()
     dns.enable_lookup()
 
     prof1 = DnsProfile()
 
     dns_provider = DnsProvider('1.1.1.1')
     prof1.add(dns_provider)
 
     dns_domain = DnsDom('name')
     prof1.add(dns_domain)
 
     dns_dmn_ext = DnsDomExt('name1')
     prof1.add(dns_dmn_ext)
 
     dns_host = DnsHost('name2', '1:1::12')
     prof1.add(dns_host)
 
     vrf1 = DnsVrf('test_vrf1')
     vrf2 = DnsVrf('test_vrf2')
 
     vrf1.use_in(dns_provider)
     vrf2.use_in(dns_dmn_ext)
 
     prof1.add(vrf1)
     prof1.add(vrf2)
 
     dns.add_profile(prof1)
     return dns