function createHealthMonitorValidate(appData, postData, callback) {
    logutils.logger.debug('createHealthMonitorValidate');
    if (!('loadbalancer-healthmonitor' in postData)) {
        error = new appErrors.RESTServerError(
                'Load Balancer Pool Health Monitor object missing ');
        callback(error, postData);
        return;
    }
    var hmCreateURL = '/loadbalancer-healthmonitors';

    var hmPostData = {};
    hmPostData['loadbalancer-healthmonitor'] = postData['loadbalancer-healthmonitor'];

    if ((!('loadbalancer-healthmonitor' in hmPostData))
            || (!('fq_name' in hmPostData['loadbalancer-healthmonitor']))) {
        error = new appErrors.RESTServerError('Enter Health Monitor Name ');
        callback(error, null);
        return;
    }
    if ((!('loadbalancer-healthmonitor' in hmPostData))
            || (!('parent_type' in hmPostData['loadbalancer-healthmonitor']))) {
        error = new appErrors.RESTServerError('Parent Type is required ');
        callback(error, null);
        return;
    }
    if (hmPostData['loadbalancer-healthmonitor']['fq_name'].length > 2) {
        var uuid = UUID.create();
        hmPostData['loadbalancer-healthmonitor']['uuid'] = uuid['hex'];
        hmPostData['loadbalancer-healthmonitor']['fq_name'][2] = uuid['hex'];
        hmPostData['loadbalancer-healthmonitor']['display_name'] = uuid['hex'];
    }

    if ((!('loadbalancer-healthmonitor' in hmPostData))
            || (!('loadbalancer_healthmonitor_properties' in hmPostData['loadbalancer-healthmonitor']))) {
        error = new appErrors.RESTServerError(
                'Health Monitor Properties are missing ');
        callback(error, null);
        return;
    }
    if ((!('loadbalancer-healthmonitor' in hmPostData))
            || (!('delay' in hmPostData['loadbalancer-healthmonitor']['loadbalancer_healthmonitor_properties']))) {
        error = new appErrors.RESTServerError(
                'Health Monitor delay is missing ');
        callback(error, null);
        return;
    }

    if ((!('loadbalancer-healthmonitor' in hmPostData))
            || (!('monitor_type' in hmPostData['loadbalancer-healthmonitor']['loadbalancer_healthmonitor_properties']))) {
        error = new appErrors.RESTServerError(
                'Health Monitor monitor_type is missing ');
        callback(error, null);
        return;
    }
    if ((!('loadbalancer-healthmonitor' in hmPostData))
            || (!('max_retries' in hmPostData['loadbalancer-healthmonitor']['loadbalancer_healthmonitor_properties']))) {
        error = new appErrors.RESTServerError(
                'Health Monitor max_retries is missing ');
        callback(error, null);
        return;
    }
    if ((!('loadbalancer-healthmonitor' in hmPostData))
            || (!('timeout' in hmPostData['loadbalancer-healthmonitor']['loadbalancer_healthmonitor_properties']))) {
        error = new appErrors.RESTServerError(
                'Health Monitor timeout is missing ');
        callback(error, null);
        return;
    }
    configApiServer
            .apiPost(
                    hmCreateURL,
                    hmPostData,
                    appData,
                    function(error, hmData) {
                        if (error) {
                            callback(error, null);
                            return;
                        }
                        var hmId = hmData['loadbalancer-healthmonitor']['uuid'];
                        readHMwithUUID(
                                hmId,
                                appData,
                                function(err, hmData) {
                                    if (err) {
                                        callback(err, postData);
                                        return;
                                    }
                                    postData['loadbalancer-healthmonitor'] = hmData['loadbalancer-healthmonitor'];
                                    callback(null, postData);
                                });
                    });
}
/**
 * createHealthMonitorValidate private function 1. Basic validation before
 * creating the Load Balancer - Pool
 */
createHealthMonitorValidate private function 1. Basic validation before
creating the Load Balancer - Pool
createHealthMonitorValidate private function 1 . Basic validation before creating the Load Balancer - Pool
function createHealthMonitorValidate(appData, postData, callback) {
    logutils.logger.debug('createHealthMonitorValidate');
    if (!('loadbalancer-healthmonitor' in postData)) {
        error = new appErrors.RESTServerError(
                'Load Balancer Pool Health Monitor object missing ');
        callback(error, postData);
        return;
    }
    var hmCreateURL = '/loadbalancer-healthmonitors';
    var hmPostData = {};
    hmPostData['loadbalancer-healthmonitor'] = postData['loadbalancer-healthmonitor'];
    if ((!('loadbalancer-healthmonitor' in hmPostData))
            || (!('fq_name' in hmPostData['loadbalancer-healthmonitor']))) {
        error = new appErrors.RESTServerError('Enter Health Monitor Name ');
        callback(error, null);
        return;
    }
    if ((!('loadbalancer-healthmonitor' in hmPostData))
            || (!('parent_type' in hmPostData['loadbalancer-healthmonitor']))) {
        error = new appErrors.RESTServerError('Parent Type is required ');
        callback(error, null);
        return;
    }
    if (hmPostData['loadbalancer-healthmonitor']['fq_name'].length > 2) {
        var uuid = UUID.create();
        hmPostData['loadbalancer-healthmonitor']['uuid'] = uuid['hex'];
        hmPostData['loadbalancer-healthmonitor']['fq_name'][2] = uuid['hex'];
        hmPostData['loadbalancer-healthmonitor']['display_name'] = uuid['hex'];
    }
    if ((!('loadbalancer-healthmonitor' in hmPostData))
            || (!('loadbalancer_healthmonitor_properties' in hmPostData['loadbalancer-healthmonitor']))) {
        error = new appErrors.RESTServerError(
                'Health Monitor Properties are missing ');
        callback(error, null);
        return;
    }
    if ((!('loadbalancer-healthmonitor' in hmPostData))
            || (!('delay' in hmPostData['loadbalancer-healthmonitor']['loadbalancer_healthmonitor_properties']))) {
        error = new appErrors.RESTServerError(
                'Health Monitor delay is missing ');
        callback(error, null);
        return;
    }
    if ((!('loadbalancer-healthmonitor' in hmPostData))
            || (!('monitor_type' in hmPostData['loadbalancer-healthmonitor']['loadbalancer_healthmonitor_properties']))) {
        error = new appErrors.RESTServerError(
                'Health Monitor monitor_type is missing ');
        callback(error, null);
        return;
    }
    if ((!('loadbalancer-healthmonitor' in hmPostData))
            || (!('max_retries' in hmPostData['loadbalancer-healthmonitor']['loadbalancer_healthmonitor_properties']))) {
        error = new appErrors.RESTServerError(
                'Health Monitor max_retries is missing ');
        callback(error, null);
        return;
    }
    if ((!('loadbalancer-healthmonitor' in hmPostData))
            || (!('timeout' in hmPostData['loadbalancer-healthmonitor']['loadbalancer_healthmonitor_properties']))) {
        error = new appErrors.RESTServerError(
                'Health Monitor timeout is missing ');
        callback(error, null);
        return;
    }
    configApiServer
            .apiPost(
                    hmCreateURL,
                    hmPostData,
                    appData,
                    function(error, hmData) {
                        if (error) {
                            callback(error, null);
                            return;
                        }
                        var hmId = hmData['loadbalancer-healthmonitor']['uuid'];
                        readHMwithUUID(
                                hmId,
                                appData,
                                function(err, hmData) {
                                    if (err) {
                                        callback(err, postData);
                                        return;
                                    }
                                    postData['loadbalancer-healthmonitor'] = hmData['loadbalancer-healthmonitor'];
                                    callback(null, postData);
                                });
                    });
}
function createHealthMonitorValidate ( appData , postData , callback ) { logutils . logger . debug ( 'createHealthMonitorValidate' ) ; if ( ! ( 'loadbalancer-healthmonitor' in postData ) ) { error = new appErrors . RESTServerError ( 'Load Balancer Pool Health Monitor object missing ' ) ; callback ( error , postData ) ; return ; } var hmCreateURL = '/loadbalancer-healthmonitors' ; var hmPostData = { } ; hmPostData [ 'loadbalancer-healthmonitor' ] = postData [ 'loadbalancer-healthmonitor' ] ; if ( ( ! ( 'loadbalancer-healthmonitor' in hmPostData ) ) || ( ! ( 'fq_name' in hmPostData [ 'loadbalancer-healthmonitor' ] ) ) ) { error = new appErrors . RESTServerError ( 'Enter Health Monitor Name ' ) ; callback ( error , null ) ; return ; } if ( ( ! ( 'loadbalancer-healthmonitor' in hmPostData ) ) || ( ! ( 'parent_type' in hmPostData [ 'loadbalancer-healthmonitor' ] ) ) ) { error = new appErrors . RESTServerError ( 'Parent Type is required ' ) ; callback ( error , null ) ; return ; } if ( hmPostData [ 'loadbalancer-healthmonitor' ] [ 'fq_name' ] . length > 2 ) { var uuid = UUID . create ( ) ; hmPostData [ 'loadbalancer-healthmonitor' ] [ 'uuid' ] = uuid [ 'hex' ] ; hmPostData [ 'loadbalancer-healthmonitor' ] [ 'fq_name' ] [ 2 ] = uuid [ 'hex' ] ; hmPostData [ 'loadbalancer-healthmonitor' ] [ 'display_name' ] = uuid [ 'hex' ] ; } if ( ( ! ( 'loadbalancer-healthmonitor' in hmPostData ) ) || ( ! ( 'loadbalancer_healthmonitor_properties' in hmPostData [ 'loadbalancer-healthmonitor' ] ) ) ) { error = new appErrors . RESTServerError ( 'Health Monitor Properties are missing ' ) ; callback ( error , null ) ; return ; } if ( ( ! ( 'loadbalancer-healthmonitor' in hmPostData ) ) || ( ! ( 'delay' in hmPostData [ 'loadbalancer-healthmonitor' ] [ 'loadbalancer_healthmonitor_properties' ] ) ) ) { error = new appErrors . RESTServerError ( 'Health Monitor delay is missing ' ) ; callback ( error , null ) ; return ; } if ( ( ! ( 'loadbalancer-healthmonitor' in hmPostData ) ) || ( ! ( 'monitor_type' in hmPostData [ 'loadbalancer-healthmonitor' ] [ 'loadbalancer_healthmonitor_properties' ] ) ) ) { error = new appErrors . RESTServerError ( 'Health Monitor monitor_type is missing ' ) ; callback ( error , null ) ; return ; } if ( ( ! ( 'loadbalancer-healthmonitor' in hmPostData ) ) || ( ! ( 'max_retries' in hmPostData [ 'loadbalancer-healthmonitor' ] [ 'loadbalancer_healthmonitor_properties' ] ) ) ) { error = new appErrors . RESTServerError ( 'Health Monitor max_retries is missing ' ) ; callback ( error , null ) ; return ; } if ( ( ! ( 'loadbalancer-healthmonitor' in hmPostData ) ) || ( ! ( 'timeout' in hmPostData [ 'loadbalancer-healthmonitor' ] [ 'loadbalancer_healthmonitor_properties' ] ) ) ) { error = new appErrors . RESTServerError ( 'Health Monitor timeout is missing ' ) ; callback ( error , null ) ; return ; } configApiServer . apiPost ( hmCreateURL , hmPostData , appData , function ( error , hmData ) { if ( error ) { callback ( error , null ) ; return ; } var hmId = hmData [ 'loadbalancer-healthmonitor' ] [ 'uuid' ] ; readHMwithUUID ( hmId , appData , function ( err , hmData ) { if ( err ) { callback ( err , postData ) ; return ; } postData [ 'loadbalancer-healthmonitor' ] = hmData [ 'loadbalancer-healthmonitor' ] ; callback ( null , postData ) ; } ) ; } ) ; }
createHealthMonitorValidate private function 1.
createHealthMonitorValidate private function 1 .