Esempio n. 1
0
def create_static_ip_configuration(ipv4_addr=None,
                                   ipv4_mask=None,
                                   ipv6_addr=None,
                                   ipv6_mask=None):
    assignments = []
    if ipv4_addr:
        assignments.append(
            IpAddressAssignment(assignment_method=BootProtocol.STATIC,
                                ip=Ip(address=ipv4_addr, netmask=ipv4_mask)))
    if ipv6_addr:
        assignments.append(
            IpAddressAssignment(assignment_method=BootProtocol.STATIC,
                                ip=Ip(address=ipv6_addr,
                                      netmask=ipv6_mask,
                                      version=IpVersion.V6)))

    return assignments
Esempio n. 2
0
def create_dhcp_ip_configuration():
    return [
        IpAddressAssignment(assignment_method=BootProtocol.DHCP),
        IpAddressAssignment(assignment_method=BootProtocol.DHCP,
                            ip=Ip(version=IpVersion.V6))
    ]