コード例 #1
0
def cloud_lb_public_ipv6(lb):
    """Given a pyrax CloudLoadbalancer object, return the IPv6 VIP address
  """
    for addr in lb.virtual_ips:
        if c4.is_valid_ipv6_address(addr):
            return addr
    # if we don't find one, then return False
    return False
コード例 #2
0
def cloud_server_public_ipv6(server):
    """Given a pyrax cloudserver object, extract and return the server's primary
  public IPv4 address.
  """
    for addr in server.networks["public"]:
        if c4.is_valid_ipv6_address(addr):
            return addr
    # if we don't find one, then return False
    return False