def get_api_vip(self, cluster):
    cluster = (cluster or self.get_details())
    api_vip = cluster.api_vip
    if ((not api_vip) and cluster.user_managed_networking):
        log.info('API VIP is not set, searching for api ip on masters')
        masters = self.get_hosts_by_role(consts.NodeRoles.MASTER, hosts=cluster.to_dict()['hosts'])
        api_vip = self._wait_for_api_vip(masters)
    log.info('api vip is %s', api_vip)
    return api_vip
def get_api_vip(self, cluster):
    cluster = (cluster or self.get_details())
    api_vip = cluster.api_vip
    if ((not api_vip) and cluster.user_managed_networking):
        log.info('API VIP is not set, searching for api ip on masters')
        masters = self.get_hosts_by_role(consts.NodeRoles.MASTER, hosts=cluster.to_dict()['hosts'])
        api_vip = self._wait_for_api_vip(masters)
    log.info('api vip is %s', api_vip)
    return api_vip