public class HttpClient extends Object implements Client
| Constructor and Description |
|---|
HttpClient(org.apache.http.impl.client.CloseableHttpClient client,
String url) |
HttpClient(org.apache.http.impl.client.HttpClientBuilder builder,
String url)
Creates a client to talk to the host on the specified port.
|
HttpClient(String url)
Creates a client to talk to the host on the specified port.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
RollupTask |
createRollupTask(RollupBuilder builder)
Create a new roll-up.
|
void |
delete(QueryBuilder builder)
Deletes data in KairosDB using the query built by the builder.
|
void |
deleteMetric(String name)
Deletes a metric.
|
void |
deleteRollupTask(String id)
Delete the roll-up.
|
Class |
getDataPointValueClass(String groupType)
Returns the data point value class for the given group type or null if one is not registered for the group type
|
List<String> |
getMetricNames()
Returns a list of all metric names.
|
RollupTask |
getRollupTask(String id)
Returns the roll-up.
|
List<RollupTask> |
getRollupTasks()
Returns a list of all roll-up tasks.
|
List<String> |
getStatus()
Returns status of Kairos Instance.
|
int |
getStatusCheck()
Returns a status code fo 204 if all is healthy.
|
DataPointTypeRegistry |
getTypeRegistry() |
String |
getVersion()
Returns the version string for the KairosDB server.
|
void |
pushMetrics(MetricBuilder builder)
Sends metrics from the builder to the KairosDB server.
|
QueryResponse |
query(QueryBuilder builder)
Queries KairosDB using the query built by the builder.
|
<T> T |
query(QueryBuilder builder,
JsonResponseHandler<T> handler)
Queries KairosDB using the query built by the builder.
|
QueryTagResponse |
queryTags(QueryTagBuilder builder)
Queries KairosDB tags using the query built by the builder.
|
<T> T |
queryTags(QueryTagBuilder builder,
JsonResponseHandler<T> handler)
Queries KairosDB tags using the query built by the builder.
|
void |
registerCustomDataType(String groupType,
Class dataPointClass)
Registers a new custom data type.
|
public HttpClient(String url) throws MalformedURLException
url - url to the KairosDB serverMalformedURLException - if url is malformedpublic HttpClient(org.apache.http.impl.client.HttpClientBuilder builder,
String url)
throws MalformedURLException
builder - client builder.url - url to the KairosDB serverMalformedURLException - if the url is malformedpublic HttpClient(org.apache.http.impl.client.CloseableHttpClient client,
String url)
throws MalformedURLException
MalformedURLExceptionpublic void registerCustomDataType(String groupType, Class dataPointClass)
ClientregisterCustomDataType in interface ClientgroupType - type used to deserialize the json on the clientdataPointClass - class that is the value of a data pointpublic Class getDataPointValueClass(String groupType)
ClientgetDataPointValueClass in interface ClientgroupType - group typepublic DataPointTypeRegistry getTypeRegistry()
public RollupTask createRollupTask(RollupBuilder builder)
ClientcreateRollupTask in interface Clientbuilder - roll-up builderpublic List<RollupTask> getRollupTasks()
ClientgetRollupTasks in interface Clientpublic RollupTask getRollupTask(String id)
ClientgetRollupTask in interface Clientid - roll-up identifierpublic void deleteRollupTask(String id)
ClientdeleteRollupTask in interface Clientid - identifier of the roll-uppublic List<String> getMetricNames()
ClientgetMetricNames in interface Clientpublic List<String> getStatus()
Clientpublic int getStatusCheck()
ClientgetStatusCheck in interface Clientpublic String getVersion()
ClientgetVersion in interface Clientpublic <T> T query(QueryBuilder builder, JsonResponseHandler<T> handler)
Clientpublic QueryResponse query(QueryBuilder builder)
Clientpublic QueryTagResponse queryTags(QueryTagBuilder builder)
Clientpublic <T> T queryTags(QueryTagBuilder builder, JsonResponseHandler<T> handler)
Clientpublic void pushMetrics(MetricBuilder builder)
ClientpushMetrics in interface Clientbuilder - metrics builderpublic void deleteMetric(String name)
ClientdeleteMetric in interface Clientname - the metric to deletepublic void delete(QueryBuilder builder)
Clientpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2020. All rights reserved.