bl/historicalData.js
/**
 * Creates a snapshot from the test data created by generateTestData
 * The connection information is taken from config.js
 */
Creates a snapshot from the test data created by generateTestData
The connection information is taken from config.js
Creates a snapshot from the test data created by generateTestData The connection information is taken from config . js
function requestCreateSnapshot( config, payload, cb) {
	console.log("Creating a snapshot...");
	request({
		url: config.aggregator + "/snapshot",
		method: "POST",
		jar: csrfRequests.cookieJar,
		headers: {
			"X-CSRF-Token": csrfRequests.csrfToken,
		},
		auth: config.credentials
	},
	function(error, response, body) {
		if (error) {
			cb( null, "Failed to create snapshot. Error is: " + error);
		}
		else if (response.statusCode != 200) {
			cb( null, "Failed to create snapshot. Response is: " + response.statusCode + " - " + body);
		}
		else {
			cb("Succeasfully created snapshot.", null);
		}
	});
}
function requestCreateSnapshot ( config , payload , cb ) { console . log ( "Creating a snapshot..." ) ; request ( { url : config . aggregator + "/snapshot" , method : "POST" , jar : csrfRequests . cookieJar , headers : { "X-CSRF-Token" : csrfRequests . csrfToken , } , auth : config . credentials } , function ( error , response , body ) { if ( error ) { cb ( null , "Failed to create snapshot. Error is: " + error ) ; } else if ( response . statusCode != 200 ) { cb ( null , "Failed to create snapshot. Response is: " + response . statusCode + " - " + body ) ; } else { cb ( "Succeasfully created snapshot." , null ) ; } } ) ; }
Creates a snapshot from the test data created by generateTestData
 The connection information is taken from config.js
Creates a snapshot from the test data created by generateTestData The connection information is taken from config . js