public TestOutcome CreateQuery(string referenceName) { TestOutcome outcome = new TestOutcome(); outcome.moduleName = "Queries"; outcome.methodName = "QueriesBuild"; try { QueriesApi queriesApi = new QueriesApi(_url); QueryTemplateArray templates = queriesApi.QueriesTemplates(_session.SessionId, "QueueItem"); foreach (QueryTemplate template in templates) { Console.WriteLine(template.Title); } QueryTemplate a_template = templates[0]; Dictionary <string, string> options = new Dictionary <string, string>(); options["reference"] = referenceName; options["properties"] = ""; Query query = queriesApi.QueriesBuild(_session.SessionId, a_template.InternalRef, new QueryArguments(options)); Console.WriteLine(query.Id); outcome.outcome = "Success"; return(outcome); } catch (Exception ex) { outcome.outcome = ex.Message; return(outcome); } }
public TestOutcome GetQueriesByTemplate() { TestOutcome outcome = new TestOutcome(); outcome.moduleName = "Queries"; outcome.methodName = "QueriesTemplates"; try { QueriesApi queriesApi = new QueriesApi(_url); QueryTemplateArray templates = queriesApi.QueriesTemplates(_session.SessionId, "ResultTask", "", 100); foreach (QueryTemplate template in templates) { Console.WriteLine(template.Title); } outcome.outcome = "Success"; return(outcome); } catch (Exception ex) { outcome.outcome = ex.Message; return(outcome); } }