io.keen.client.java.SavedQueries Maven / Gradle / Ivy
package io.keen.client.java;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import io.keen.client.java.result.QueryResult;
/**
* Represents the set of operations that can be performed against the
* Saved/Cached Query API endpoints.
*
* @author masojus
*/
public interface SavedQueries {
/**
* Save the given query.
*
* @param queryName The resource name for the query. Alphanumerics, hyphens, and underscores.
* @param query The query definition.
*
* @return The raw return value of the PUT request as a Map containing the complete new
* Saved/Cached Query definition with auditing like created/updated/run information.
* @throws IOException If there is an error creating the Saved Query.
*/
Map createSavedQuery(String queryName,
KeenQueryRequest query) throws IOException;
/**
* Save the given query.
*
* @param queryName The resource name for the query. Alphanumerics, hyphens, and underscores.
* @param query The query definition.
* @param displayName The display name to be used for this resource.
*
* @return The raw return value of the PUT request as a Map containing the complete new
* Saved/Cached Query definition with auditing like created/updated/run information.
* @throws IOException If there is an error creating the Saved Query.
*/
Map createSavedQuery(String queryName,
KeenQueryRequest query,
String displayName) throws IOException;
/**
* Save the given query as a cached query.
*
* @param queryName The resource name for the query. Alphanumerics, hyphens, and underscores.
* @param query The query definition.
* @param refreshRate The refresh rate for this cached query, empirically in the range
* [14400, 86400] seconds or 4-24 hrs.
*
* @return The raw return value of the PUT request as a Map containing the complete new
* Saved/Cached Query definition with auditing like created/updated/run information.
* @throws IOException If there is an error creating the Cached Query.
*/
Map createCachedQuery(String queryName,
KeenQueryRequest query,
int refreshRate) throws IOException;
/**
* Save the given query as a cached query.
*
* @param queryName The resource name for the query. Alphanumerics, hyphens, and underscores.
* @param query The query definition.
* @param displayName The display name to be used for this resource.
* @param refreshRate The refresh rate for this cached query, empirically in the range
* [14400, 86400] seconds or 4-24 hrs.
*
* @return The raw return value of the PUT request as a Map containing the complete new
* Saved/Cached Query definition with auditing like created/updated/run information.
* @throws IOException If there is an error creating the Cached Query.
*/
Map createCachedQuery(String queryName,
KeenQueryRequest query,
String displayName,
int refreshRate) throws IOException;
/**
* Get a single Saved/Cached query definition.
*
* @param queryName The resource name for the query.
*
* @return The definition for the given query resource.
* @throws IOException If there is an error getting the Saved/Cached Query definition.
*/
Map getDefinition(String queryName) throws IOException;
/**
* Get all Saved/Cached Query definitions.
*
* @return All the Saved/Cached query definitions for this project.
* @throws IOException If there is an error getting the Saved/Cached Query definitions.
*/
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy