Query Creation

This is a single synchronous call where the results are returned immediately after specifying the query:
POST <baseurl>/api/v2/query
The result can be any of the following items:
  • Success: The query returns information about the query, including the ID number of the query and the schema of the results. When the query creation succeeds, although the call returns immediately, LogLogic starts the process of generating results in the background.
  • Failure: The result is a failure if the query is invalid, for example, if there are syntax errors. In such case, the error details are returned.

Two more parameters can be specified in addition to the query itself:

  • cached: Using this parameter, the results are cached temporarily. This allows you to retrieve any window of results from the total results, effectively allowing you to scroll the results up and down. It also allows you to run sub-queries, which is allowed only if the query is cached.
    Note: Cached queries have a performance penalty and should be only used if needed.
  • timeToLive: The time of inactivity in seconds, after which the query is automatically deleted. The default is 0, which indicates never auto-deleting the query.

The query returns:

  • The query ID
  • The schema: An array of column descriptors, where each column descriptor contains the name and the type of the column. Similar to a header in a table, the column descriptor allows you to identify the values in each column. You use the column descriptor to interpret the results, as each row in the results is represented by a raw array.