function parseVNSubnets(vmiData, appData, lbs, callback) {
    logutils.logger.debug('parseVNSubnets');
    var reqUrlfp = null;
    var dataObjArr = [];
    var i = 0, lisLength = 0;
    var vrVMIRef = [];
    _
            .each(
                    vmiData,
                    function(vmi) {
                        // logutils.logger.debug(JSON.stringify(vmi['virtual-machine-interface']));
                        if ('virtual_network_refs' in vmi['virtual-machine-interface']) {
                            vrVMIRef
                                    .push(vmi['virtual-machine-interface']['virtual_network_refs'][0]);
                        }
                    });
    // logutils.logger.debug(JSON.stringify(vrVMIRef));
    _.each(vrVMIRef, function(vrObj) {
        reqUrl = '/virtual-network/' + vrObj['uuid'] + '?exclude_hrefs=true';
        // logutils.logger.debug(reqUrl);
        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) {
                                // logutils.logger.debug(JSON.stringify(results));
                                for (var lb = 0; lb < lbs['loadbalancers'].length; lb++) {
                                    var vmi_refs = lbs['loadbalancers'][lb]['loadbalancer']['virtual_machine_interface_refs'];
                                    // logutils.logger.debug(JSON.stringify(vmi_refs));
                                    if (lbs['loadbalancers'][lb]['loadbalancer'] != null
                                            && vmi_refs != null
                                            && vmi_refs.length > 0) {
                                        for (i = 0; i < vmi_refs.length; i++) {
                                            for (var l = 0; l < results.length; l++) {
                                                if (results[l]['virtual-network'] != null) {
                                                    var vmibackRefs = results[l]['virtual-network']['virtual_machine_interface_back_refs'];
                                                    _
                                                            .each(
                                                                    vmibackRefs,
                                                                    function(
                                                                            vmibackRef) {
                                                                        // logutils.logger.debug(JSON.stringify('vmibackRef[uuid]:'+vmibackRef['uuid']));
                                                                        // logutils.logger.debug(JSON.stringify('vmi_refs[i][uuid]:'+vmi_refs[i]['uuid']));
                                                                        if (vmibackRef['uuid'] === vmi_refs[i]['uuid']) {
                                                                            vmi_refs[i]['virtual-network'] = {};
                                                                            vmi_refs[i]['virtual-network'].uuid = results[l]['virtual-network']['uuid'];
                                                                            vmi_refs[i]['virtual-network'].display_name = results[l]['virtual-network']['display_name'];
                                                                            vmi_refs[i]['virtual-network'].name = results[l]['virtual-network']['name'];
                                                                            vmi_refs[i]['virtual-network'].network_ipam_refs = results[l]['virtual-network']['network_ipam_refs'];
                                                                        }
                                                                    });
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                        callback(null, lbs);
                    });
}
/**
 * parseVNSubnets
 * 
 * @private function Return call back it parse the subnet info.
 * @param lbs
 * @param vmiData
 * @param appData
 * @param callback
 * @returns
 */


@private function Return call back it parse the subnet info.
@private function Return call back it parse the subnet info .
function parseVNSubnets(vmiData, appData, lbs, callback) {
    logutils.logger.debug('parseVNSubnets');
    var reqUrlfp = null;
    var dataObjArr = [];
    var i = 0, lisLength = 0;
    var vrVMIRef = [];
    _
            .each(
                    vmiData,
                    function(vmi) {
                        if ('virtual_network_refs' in vmi['virtual-machine-interface']) {
                            vrVMIRef
                                    .push(vmi['virtual-machine-interface']['virtual_network_refs'][0]);
                        }
                    });
    _.each(vrVMIRef, function(vrObj) {
        reqUrl = '/virtual-network/' + vrObj['uuid'] + '?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 vmi_refs = lbs['loadbalancers'][lb]['loadbalancer']['virtual_machine_interface_refs'];
                                    if (lbs['loadbalancers'][lb]['loadbalancer'] != null
                                            && vmi_refs != null
                                            && vmi_refs.length > 0) {
                                        for (i = 0; i < vmi_refs.length; i++) {
                                            for (var l = 0; l < results.length; l++) {
                                                if (results[l]['virtual-network'] != null) {
                                                    var vmibackRefs = results[l]['virtual-network']['virtual_machine_interface_back_refs'];
                                                    _
                                                            .each(
                                                                    vmibackRefs,
                                                                    function(
                                                                            vmibackRef) {
                                                                        if (vmibackRef['uuid'] === vmi_refs[i]['uuid']) {
                                                                            vmi_refs[i]['virtual-network'] = {};
                                                                            vmi_refs[i]['virtual-network'].uuid = results[l]['virtual-network']['uuid'];
                                                                            vmi_refs[i]['virtual-network'].display_name = results[l]['virtual-network']['display_name'];
                                                                            vmi_refs[i]['virtual-network'].name = results[l]['virtual-network']['name'];
                                                                            vmi_refs[i]['virtual-network'].network_ipam_refs = results[l]['virtual-network']['network_ipam_refs'];
                                                                        }
                                                                    });
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                        callback(null, lbs);
                    });
}
function parseVNSubnets ( vmiData , appData , lbs , callback ) { logutils . logger . debug ( 'parseVNSubnets' ) ; var reqUrlfp = null ; var dataObjArr = [ ] ; var i = 0 , lisLength = 0 ; var vrVMIRef = [ ] ; _ . each ( vmiData , function ( vmi ) { if ( 'virtual_network_refs' in vmi [ 'virtual-machine-interface' ] ) { vrVMIRef . push ( vmi [ 'virtual-machine-interface' ] [ 'virtual_network_refs' ] [ 0 ] ) ; } } ) ; _ . each ( vrVMIRef , function ( vrObj ) { reqUrl = '/virtual-network/' + vrObj [ 'uuid' ] + '?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 vmi_refs = lbs [ 'loadbalancers' ] [ lb ] [ 'loadbalancer' ] [ 'virtual_machine_interface_refs' ] ; if ( lbs [ 'loadbalancers' ] [ lb ] [ 'loadbalancer' ] != null && vmi_refs != null && vmi_refs . length > 0 ) { for ( i = 0 ; i < vmi_refs . length ; i ++ ) { for ( var l = 0 ; l < results . length ; l ++ ) { if ( results [ l ] [ 'virtual-network' ] != null ) { var vmibackRefs = results [ l ] [ 'virtual-network' ] [ 'virtual_machine_interface_back_refs' ] ; _ . each ( vmibackRefs , function ( vmibackRef ) { if ( vmibackRef [ 'uuid' ] === vmi_refs [ i ] [ 'uuid' ] ) { vmi_refs [ i ] [ 'virtual-network' ] = { } ; vmi_refs [ i ] [ 'virtual-network' ] . uuid = results [ l ] [ 'virtual-network' ] [ 'uuid' ] ; vmi_refs [ i ] [ 'virtual-network' ] . display_name = results [ l ] [ 'virtual-network' ] [ 'display_name' ] ; vmi_refs [ i ] [ 'virtual-network' ] . name = results [ l ] [ 'virtual-network' ] [ 'name' ] ; vmi_refs [ i ] [ 'virtual-network' ] . network_ipam_refs = results [ l ] [ 'virtual-network' ] [ 'network_ipam_refs' ] ; } } ) ; } } } } } } } callback ( null , lbs ) ; } ) ; }
parseVNSubnets
parseVNSubnets
// logutils.logger.debug(JSON.stringify(vmi['virtual-machine-interface'])); // logutils.logger.debug(JSON.stringify(vrVMIRef)); // logutils.logger.debug(reqUrl); // logutils.logger.debug(JSON.stringify(results)); // logutils.logger.debug(JSON.stringify(vmi_refs)); // logutils.logger.debug(JSON.stringify('vmibackRef[uuid]:'+vmibackRef['uuid'])); // logutils.logger.debug(JSON.stringify('vmi_refs[i][uuid]:'+vmi_refs[i]['uuid']));