function parseInstanceIps(vmiData, appData, lbs, callback) {
    logutils.logger.debug('parseInstanceIps');
    var reqUrlfp = null;
    var dataObjArr = [];
    var i = 0, lisLength = 0;

    var instanceipPoolRef = [];
    if (vmiData != null && vmiData.length > 0) {
        _
                .each(
                        vmiData,
                        function(vmi) {
                            if ('instance_ip_back_refs' in vmi['virtual-machine-interface']) {
                                var instanceRefs = vmi['virtual-machine-interface']['instance_ip_back_refs'];
                                _.each(instanceRefs, function(ip) {
                                    instanceipPoolRef.push(ip['uuid']);
                                });
                            }
                        });
    }
    // logutils.logger.debug("instance_ip_back_refs:",instanceipPoolRef);
    _.each(instanceipPoolRef, function(id) {
        reqUrl = '/instance-ip/' + id + '?exclude_hrefs=true';
        commonUtils.createReqObj(dataObjArr, reqUrl, global.HTTP_REQUEST_GET,
                null, null, null, appData);
    });
    if (!dataObjArr.length) {
        callback(null, lbs);
        return;
    }
    async
            .map(
                    dataObjArr,
                    commonUtils.getAPIServerResponse(configApiServer.apiGet,
                            true),
                    function(error, results) {
                        if (error) {
                            callback(error, lbs);
                            return;
                        }
                        // logutils.logger.debug(JSON.stringify(results));
                        if (results != null && results.length > 0) {
                            if (lbs['loadbalancers'].length > 0
                                    && results != null && results.length > 0) {
                                for (var lb = 0; lb < lbs['loadbalancers'].length; lb++) {
                                    var lb_vmi_refs = lbs['loadbalancers'][lb]['loadbalancer']['virtual_machine_interface_refs'];
                                    if (lb_vmi_refs != null
                                            && lb_vmi_refs.length > 0) {
                                        for (vmi = 0; vmi < lb_vmi_refs.length; vmi++) {
                                            // logutils.logger.debug("lb_vmi_refs",lb_vmi_refs[vmi]);
                                            for (var ip = 0; ip < results.length; ip++) {
                                                if (results[ip]['instance-ip'] != null) {
                                                    var vmi_ref_ip = results[ip]['instance-ip']['virtual_machine_interface_refs']
                                                    // logutils.logger.debug("vmi_ref_ip",vmi_ref_ip);
                                                    var vmi_ref_ip_len = vmi_ref_ip.length;
                                                    for (x = 0; x < vmi_ref_ip_len; x++) {
                                                        if (lb_vmi_refs[vmi]['uuid'] == vmi_ref_ip[x]['uuid']) {
                                                            lb_vmi_refs[vmi]['instance-ip'].instance_ip_address = results[ip]['instance-ip']['instance_ip_address'];
                                                            lb_vmi_refs[vmi]['instance-ip'].uuid = results[ip]['instance-ip']['uuid'];
                                                            lb_vmi_refs[vmi]['instance-ip'].instance_ip_mode = results[ip]['instance-ip']['instance_ip_mode'];
                                                            var vipAddress = lbs['loadbalancers'][lb]['loadbalancer']['loadbalancer_properties']['vip_address'];
                                                            if (vipAddress == null
                                                                    || vipAddress == "") {
                                                                // logutils.logger.debug("VIP
                                                                // Address
                                                                // Empty"+vipAddress);
                                                                lbs['loadbalancers'][lb]['loadbalancer']['loadbalancer_properties']['vip_address'] = results[ip]['instance-ip']['instance_ip_address'];
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                        callback(null, lbs);
                    });
}
/**
 * parseInstanceIps
 * 
 * @private function Return call back it parse the instance-ips.
 * @param lbs
 * @param vmiData
 * @param appData
 * @param callback
 * @returns
 */


@private function Return call back it parse the instance-ips.
@private function Return call back it parse the instance - ips .
function parseInstanceIps(vmiData, appData, lbs, callback) {
    logutils.logger.debug('parseInstanceIps');
    var reqUrlfp = null;
    var dataObjArr = [];
    var i = 0, lisLength = 0;
    var instanceipPoolRef = [];
    if (vmiData != null && vmiData.length > 0) {
        _
                .each(
                        vmiData,
                        function(vmi) {
                            if ('instance_ip_back_refs' in vmi['virtual-machine-interface']) {
                                var instanceRefs = vmi['virtual-machine-interface']['instance_ip_back_refs'];
                                _.each(instanceRefs, function(ip) {
                                    instanceipPoolRef.push(ip['uuid']);
                                });
                            }
                        });
    }
    _.each(instanceipPoolRef, function(id) {
        reqUrl = '/instance-ip/' + id + '?exclude_hrefs=true';
        commonUtils.createReqObj(dataObjArr, reqUrl, global.HTTP_REQUEST_GET,
                null, null, null, appData);
    });
    if (!dataObjArr.length) {
        callback(null, lbs);
        return;
    }
    async
            .map(
                    dataObjArr,
                    commonUtils.getAPIServerResponse(configApiServer.apiGet,
                            true),
                    function(error, results) {
                        if (error) {
                            callback(error, lbs);
                            return;
                        }
                        if (results != null && results.length > 0) {
                            if (lbs['loadbalancers'].length > 0
                                    && results != null && results.length > 0) {
                                for (var lb = 0; lb < lbs['loadbalancers'].length; lb++) {
                                    var lb_vmi_refs = lbs['loadbalancers'][lb]['loadbalancer']['virtual_machine_interface_refs'];
                                    if (lb_vmi_refs != null
                                            && lb_vmi_refs.length > 0) {
                                        for (vmi = 0; vmi < lb_vmi_refs.length; vmi++) {
                                            for (var ip = 0; ip < results.length; ip++) {
                                                if (results[ip]['instance-ip'] != null) {
                                                    var vmi_ref_ip = results[ip]['instance-ip']['virtual_machine_interface_refs']
                                                    var vmi_ref_ip_len = vmi_ref_ip.length;
                                                    for (x = 0; x < vmi_ref_ip_len; x++) {
                                                        if (lb_vmi_refs[vmi]['uuid'] == vmi_ref_ip[x]['uuid']) {
                                                            lb_vmi_refs[vmi]['instance-ip'].instance_ip_address = results[ip]['instance-ip']['instance_ip_address'];
                                                            lb_vmi_refs[vmi]['instance-ip'].uuid = results[ip]['instance-ip']['uuid'];
                                                            lb_vmi_refs[vmi]['instance-ip'].instance_ip_mode = results[ip]['instance-ip']['instance_ip_mode'];
                                                            var vipAddress = lbs['loadbalancers'][lb]['loadbalancer']['loadbalancer_properties']['vip_address'];
                                                            if (vipAddress == null
                                                                    || vipAddress == "") {
                                                                lbs['loadbalancers'][lb]['loadbalancer']['loadbalancer_properties']['vip_address'] = results[ip]['instance-ip']['instance_ip_address'];
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                        callback(null, lbs);
                    });
}
function parseInstanceIps ( vmiData , appData , lbs , callback ) { logutils . logger . debug ( 'parseInstanceIps' ) ; var reqUrlfp = null ; var dataObjArr = [ ] ; var i = 0 , lisLength = 0 ; var instanceipPoolRef = [ ] ; if ( vmiData != null && vmiData . length > 0 ) { _ . each ( vmiData , function ( vmi ) { if ( 'instance_ip_back_refs' in vmi [ 'virtual-machine-interface' ] ) { var instanceRefs = vmi [ 'virtual-machine-interface' ] [ 'instance_ip_back_refs' ] ; _ . each ( instanceRefs , function ( ip ) { instanceipPoolRef . push ( ip [ 'uuid' ] ) ; } ) ; } } ) ; } _ . each ( instanceipPoolRef , function ( id ) { reqUrl = '/instance-ip/' + id + '?exclude_hrefs=true' ; commonUtils . createReqObj ( dataObjArr , reqUrl , global . HTTP_REQUEST_GET , null , null , null , appData ) ; } ) ; if ( ! dataObjArr . length ) { callback ( null , lbs ) ; return ; } async . map ( dataObjArr , commonUtils . getAPIServerResponse ( configApiServer . apiGet , true ) , function ( error , results ) { if ( error ) { callback ( error , lbs ) ; return ; } if ( results != null && results . length > 0 ) { if ( lbs [ 'loadbalancers' ] . length > 0 && results != null && results . length > 0 ) { for ( var lb = 0 ; lb < lbs [ 'loadbalancers' ] . length ; lb ++ ) { var lb_vmi_refs = lbs [ 'loadbalancers' ] [ lb ] [ 'loadbalancer' ] [ 'virtual_machine_interface_refs' ] ; if ( lb_vmi_refs != null && lb_vmi_refs . length > 0 ) { for ( vmi = 0 ; vmi < lb_vmi_refs . length ; vmi ++ ) { for ( var ip = 0 ; ip < results . length ; ip ++ ) { if ( results [ ip ] [ 'instance-ip' ] != null ) { var vmi_ref_ip = results [ ip ] [ 'instance-ip' ] [ 'virtual_machine_interface_refs' ] var vmi_ref_ip_len = vmi_ref_ip . length ; for ( x = 0 ; x < vmi_ref_ip_len ; x ++ ) { if ( lb_vmi_refs [ vmi ] [ 'uuid' ] == vmi_ref_ip [ x ] [ 'uuid' ] ) { lb_vmi_refs [ vmi ] [ 'instance-ip' ] . instance_ip_address = results [ ip ] [ 'instance-ip' ] [ 'instance_ip_address' ] ; lb_vmi_refs [ vmi ] [ 'instance-ip' ] . uuid = results [ ip ] [ 'instance-ip' ] [ 'uuid' ] ; lb_vmi_refs [ vmi ] [ 'instance-ip' ] . instance_ip_mode = results [ ip ] [ 'instance-ip' ] [ 'instance_ip_mode' ] ; var vipAddress = lbs [ 'loadbalancers' ] [ lb ] [ 'loadbalancer' ] [ 'loadbalancer_properties' ] [ 'vip_address' ] ; if ( vipAddress == null || vipAddress == "" ) { lbs [ 'loadbalancers' ] [ lb ] [ 'loadbalancer' ] [ 'loadbalancer_properties' ] [ 'vip_address' ] = results [ ip ] [ 'instance-ip' ] [ 'instance_ip_address' ] ; } } } } } } } } } } callback ( null , lbs ) ; } ) ; }
parseInstanceIps
parseInstanceIps
// logutils.logger.debug("instance_ip_back_refs:",instanceipPoolRef); // logutils.logger.debug(JSON.stringify(results)); // logutils.logger.debug("lb_vmi_refs",lb_vmi_refs[vmi]); // logutils.logger.debug("vmi_ref_ip",vmi_ref_ip); // logutils.logger.debug("VIP // Address // Empty"+vipAddress);