-
Notifications
You must be signed in to change notification settings - Fork 477
/
Copy pathInfluxDBService.java
93 lines (76 loc) · 3.64 KB
/
InfluxDBService.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
package org.influxdb.impl;
import org.influxdb.dto.QueryResult;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.Streaming;
interface InfluxDBService {
public static final String U = "u";
public static final String P = "p";
public static final String Q = "q";
public static final String DB = "db";
public static final String RP = "rp";
public static final String PARAMS = "params";
public static final String PRECISION = "precision";
public static final String CONSISTENCY = "consistency";
public static final String EPOCH = "epoch";
public static final String CHUNK_SIZE = "chunk_size";
@GET("ping")
public Call<ResponseBody> ping();
/**
* @param username u: optional The username for authentication
* @param password p: optional The password for authentication
* @param database db: required The database to write points
* @param retentionPolicy rp: optional The retention policy to write points.
* If not specified, the autogen retention
* @param precision optional The precision of the time stamps (n, u, ms, s, m, h).
* If not specified, n
* @param consistency optional The write consistency level required for the write to succeed.
* Can be one of one, any, all, quorum. Defaults to all.
*/
@POST("write")
public Call<ResponseBody> writePoints(@Query(DB) String database,
@Query(RP) String retentionPolicy, @Query(PRECISION) String precision,
@Query(CONSISTENCY) String consistency, @Body RequestBody batchPoints);
@GET("query")
public Call<QueryResult> query(@Query(DB) String db,
@Query(EPOCH) String epoch, @Query(value = Q, encoded = true) String query);
@POST("query")
public Call<QueryResult> query(@Query(DB) String db,
@Query(EPOCH) String epoch, @Query(value = Q, encoded = true) String query,
@Query(value = PARAMS, encoded = true) String params);
@GET("query")
public Call<QueryResult> query(@Query(DB) String db,
@Query(value = Q, encoded = true) String query);
@POST("query")
public Call<QueryResult> postQuery(@Query(DB) String db,
@Query(value = Q, encoded = true) String query);
@POST("query")
public Call<QueryResult> postQuery(@Query(DB) String db,
@Query(value = Q, encoded = true) String query, @Query(value = PARAMS, encoded = true) String params);
@GET("query")
public Call<QueryResult> query(@Query(value = Q, encoded = true) String query);
@POST("query")
public Call<QueryResult> postQuery(@Query(value = Q, encoded = true) String query);
@Streaming
@GET("query?chunked=true")
public Call<ResponseBody> query(@Query(DB) String db, @Query(value = Q, encoded = true) String query,
@Query(CHUNK_SIZE) int chunkSize);
@Streaming
@GET("query?chunked=true")
public Call<ResponseBody> query(@Query(DB) String db, @Query(value = Q, encoded = true) String query,
@Query(EPOCH) String epoch, @Query(CHUNK_SIZE) int chunkSize);
@Streaming
@POST("query?chunked=true")
public Call<ResponseBody> query(@Query(DB) String db, @Query(value = Q, encoded = true) String query,
@Query(CHUNK_SIZE) int chunkSize, @Query(value = PARAMS, encoded = true) String params);
@Streaming
@POST("query?chunked=true")
public Call<ResponseBody> query(@Query(DB) String db, @Query(value = Q, encoded = true) String query,
@Query(EPOCH) String precision, @Query(CHUNK_SIZE) int chunkSize,
@Query(value = PARAMS, encoded = true) String params);
}