Java Project to download the iteration summary report / REST API to get report data.
UseHow can we use our API to download iteration reports as CSV based on specific executions?
You can use our AppvanceRestClient.jar to get the iteration summary report downloaded to a directory of your choosing. For that, create a Java project adding the following dependencies:
1. AppvanceRestClient.jar
https://s3-us-west-2.amazonaws.com/appvance-rest-client/AppvanceRestClient.jar
2. Download this articlefile and extract it. Add all .jars in this zip to your project library:
https://s3-us-west-2.amazonaws.com/appvance-rest-client/lib.zip
Also here is a sample main method which downloads a csv iteration summary report
package appvancerestclientdemo;
import com.appvance.enterprise.rest.client.AppvanceRestClient;
import org.json.JSONArray;
public class AppvanceRestClientDemo {
/*
* this will save an iteration summary report in the directory specified. Can be windows or windows path. * look in line for comments on necessary arguments.
*
public static void main(String[] args) throws Exception {
AppvanceRestClient arc = new AppvanceRestClient("http://localhost:8080"); // provide your Appvance IQ server dns or ip
arc.logIn("appvance", "appvance");
String executionId = "1520546604589"; // get this id when reportyou datarun your scenario in the output section, like "Execution ID = 1520548008690" String config = "default"; // this config refers to the database configuration used when running scenario, normally use "default" JSONArray iterationInfo = arc.getIterations(config, executionId);
String iterId = iterationInfo.getJSONObject(0).getInt("id")+""; // gets the id of the fist iteration of your execution
boolean status = arc.downloadSummaryReport("/Users/oscar/Documents/", config, executionId, iterId); // downloads the CSV or iterationreturn summariesfalse
needSystem.out.println("File download: "+status);
}
}
Note: Not all reports are accessible right now on this AppvaceRestClient.
REST API to get report data:
Following is the way using just the rest calls.
There has been added some concepts like summaryId, report template and offset that were not when the documentation was compiled. Following would be retrievedthe programmaticallylist fromof AIQ.
Validationnecessary workflow
to Confirmget a CSV summary report.
Provided you are logged in and have the executionIDId, following would be the list of calls necessary to get a CSV summary report.
1. GET SCENARIO ITERATIONS (from this response need the summaryId andreportthetypeiterIdrequiredasbyin attached image)
http://localhost:8080/AppvanceServer/rest/reports/getIterations?config=default&exeId=1520986267004
2. GET TICKS (take theconsumer.Callbiggerthenumber,approvedthisAIQareAPIoffsetwithinauthorizedsecscredentialswhereandyoucapturecanthepullresponse.Validatereport,thelikedownloadedadatasnapshotagainstinthetime)
http://localhost:8080/AppvanceServer/rest/reports/getTicks?config=default&exeId=1520986267004&iterId=-1386405882
3.AIQGETUITEMPLATEbeforeNAMEautomating(normallydownstreamcanprocessing.
http://localhost:8080/AppvanceServer/rest/reports/getTemplateNames
4. GET SUMMARY REPORT
http://localhost:8080/AppvanceServer/rest/reports/getSummary?config=default&iterId=-1341233&summaryId=2171777&offset=180&template=All%20Reports
Last updated: SeptemberJuly 28, 20262023
If you have any feedback on this topic, please contact us at documentation@appvance.ai