Showing
1 changed file
with
14 additions
and
0 deletions
... | ... | @@ -46,6 +46,7 @@ import org.thingsboard.server.common.data.UpdateMessage; |
46 | 46 | import org.thingsboard.server.common.data.User; |
47 | 47 | import org.thingsboard.server.common.data.alarm.Alarm; |
48 | 48 | import org.thingsboard.server.common.data.edge.Edge; |
49 | +import org.thingsboard.server.common.data.edge.EdgeEvent; | |
49 | 50 | import org.thingsboard.server.common.data.edge.EdgeSearchQuery; |
50 | 51 | import org.thingsboard.server.common.data.alarm.AlarmInfo; |
51 | 52 | import org.thingsboard.server.common.data.alarm.AlarmSearchStatus; |
... | ... | @@ -2311,6 +2312,19 @@ public class RestClient implements ClientHttpRequestInterceptor, Closeable { |
2311 | 2312 | }).getBody(); |
2312 | 2313 | } |
2313 | 2314 | |
2315 | + public TimePageData<EdgeEvent> getEdgeEvents(EdgeId edgeId, TimePageLink pageLink) { | |
2316 | + Map<String, String> params = new HashMap<>(); | |
2317 | + params.put("edgeId", edgeId.toString()); | |
2318 | + addPageLinkToParam(params, pageLink); | |
2319 | + return restTemplate.exchange( | |
2320 | + baseURL + "/api/edge/{edgeId}/events?" + getUrlParams(pageLink), | |
2321 | + HttpMethod.GET, | |
2322 | + HttpEntity.EMPTY, | |
2323 | + new ParameterizedTypeReference<TimePageData<EdgeEvent>>() { | |
2324 | + }, | |
2325 | + params).getBody(); | |
2326 | + } | |
2327 | + | |
2314 | 2328 | @Deprecated |
2315 | 2329 | public Optional<JsonNode> getAttributes(String accessToken, String clientKeys, String sharedKeys) { |
2316 | 2330 | Map<String, String> params = new HashMap<>(); | ... | ... |