Beispiel #1
0
def getSubnetAndZoneFreeIp(subnet, zone, current=None):
    ret = ""
    dhcp = Dhcp()
    dns = Dns()
    ip = dhcp.getSubnetFreeIp(subnet, current)
    while ip:
        if not dns.ipExists(zone, ip):
            ret = ip
            break
        ip = dhcp.getSubnetFreeIp(subnet, ip)
    return ret
Beispiel #2
0
def getSubnetAndZoneFreeIp(subnet, zone, current = None):
    ret = ""
    dhcp = Dhcp()
    dns = Dns()
    ip = dhcp.getSubnetFreeIp(subnet, current)
    while ip:
        if not dns.ipExists(zone, ip):
            ret = ip
            break
        ip = dhcp.getSubnetFreeIp(subnet, ip)
    return ret
Beispiel #3
0
def addZone(zonename,
            network=None,
            netmask=None,
            reverse=False,
            description=None,
            nameserver=None,
            nameserverip=None):
    Dns().addZone(zonename, network, netmask, reverse, description, nameserver,
                  nameserverip)
Beispiel #4
0
def addZoneWithSubnet(zonename,
                      network,
                      netmask,
                      reverse=False,
                      description=None,
                      nameserver=None,
                      nameserverip=None):
    Dns().addZone(zonename, network, netmask, reverse, description, nameserver,
                  nameserverip)
    d = Dhcp()
    d.addSubnet(network, netmask, zonename)
    d.setSubnetOption(network, "domain-name", '"' + zonename + '"')
    if nameserverip:
        d.setSubnetOption(network, "domain-name-servers", nameserverip)
Beispiel #5
0
def getZoneRecordById(zone, id):
    return Dns().getZoneRecordById(zone, id)
Beispiel #6
0
def getMXRecords(zone):
    return Dns().getMXRecords(zone)
Beispiel #7
0
def delCNAMEs(zone, hostname):
    Dns().delCNAMEs(zone, hostname)
Beispiel #8
0
def setHostAliases(zone, host, aliases):
    return Dns().setHostAliases(zone, host, aliases)
Beispiel #9
0
def resolve(zone, hostname):
    return Dns().resolve(zone, hostname)
Beispiel #10
0
def getResourceRecord(zone, rr):
    return Dns().getResourceRecord(zone, rr)
Beispiel #11
0
def delRecord(zone, hostname):
    Dns().delRecord(zone, hostname)
Beispiel #12
0
def hostExists(zone, hostname):
    return Dns().hostExists(zone, hostname)
Beispiel #13
0
def delRecordById(zone, id):
    return Dns().delRecordById(zone, id)
Beispiel #14
0
def addRecordA(zone, hostname, ip):
    return Dns().addRecordA(zone, hostname, ip)
Beispiel #15
0
def addRecord(zone, type, hostname, value):
    return Dns().addRecord(zone, type, hostname, value)
Beispiel #16
0
def hasRecord(zone, type, hostname):
    return Dns().hasRecord(zone, type, hostname)
Beispiel #17
0
def modifyRecordById(zone, id, hostname, value):
    return Dns().modifyRecordById(zone, id, hostname, value)
Beispiel #18
0
def getSOAARecord(zone):
    return Dns().getSOAARecord(zone)
Beispiel #19
0
def modifyRecord(zone, hostname, ip):
    Dns().modifyRecord(zone, hostname, ip)
Beispiel #20
0
def setZoneDescription(zone, description):
    Dns().setZoneDescription(zone, description)
Beispiel #21
0
def setSOANSRecord(zone, nameserver):
    Dns().setSOANSRecord(zone, nameserver)
Beispiel #22
0
def ipExists(zone, ip):
    return Dns().ipExists(zone, ip)
Beispiel #23
0
def setSOAARecord(zone, ip):
    Dns().setSOAARecord(zone, ip)
Beispiel #24
0
def getZoneFreeIp(zone, startAt=None):
    return Dns().getZoneFreeIp(zone, startAt)
Beispiel #25
0
def getZoneData(zone, filt):
    return Dns().getZoneData(zone, filt)
Beispiel #26
0
def getCNAMEs(zone, hostname):
    return Dns().getCNAMEs(zone, hostname)
Beispiel #27
0
def setMXRecords(zone, mxservers):
    Dns().setMXRecords(zone, mxservers)
Beispiel #28
0
def addRecordCNAME(zone, alias, cname, dnsClass="IN"):
    Dns().addRecordCNAME(zone, alias, cname, dnsClass)
Beispiel #29
0
def getNSRecords(zone):
    return Dns().getNSRecords(zone)
Beispiel #30
0
def setNSRecords(zone, nameservers):
    Dns().setNSRecords(zone, nameservers)
Beispiel #31
0
def getZoneRecords(zone, filt):
    return Dns().getZoneRecords(zone, filt)