|
|
|
@ -1,12 +1,12 @@ |
|
|
|
/** |
|
|
|
* Copyright © 2016-2018 The Thingsboard Authors |
|
|
|
* |
|
|
|
* <p> |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
* You may obtain a copy of the License at |
|
|
|
* |
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
* |
|
|
|
* <p> |
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
* <p> |
|
|
|
* Unless required by applicable law or agreed to in writing, software |
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, |
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
|
|
@ -115,7 +115,7 @@ public class TelemetryController extends BaseController { |
|
|
|
} |
|
|
|
|
|
|
|
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')") |
|
|
|
@RequestMapping(value = "/{entityType}/{entityId}/keys/ATTRIBUTES", method = RequestMethod.GET) |
|
|
|
@RequestMapping(value = "/{entityType}/{entityId}/keys/attributes", method = RequestMethod.GET) |
|
|
|
@ResponseBody |
|
|
|
public DeferredResult<ResponseEntity> getAttributeKeys( |
|
|
|
@PathVariable("entityType") String entityType, @PathVariable("entityId") String entityIdStr) throws ThingsboardException { |
|
|
|
@ -123,7 +123,7 @@ public class TelemetryController extends BaseController { |
|
|
|
} |
|
|
|
|
|
|
|
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')") |
|
|
|
@RequestMapping(value = "/{entityType}/{entityId}/keys/ATTRIBUTES/{scope}", method = RequestMethod.GET) |
|
|
|
@RequestMapping(value = "/{entityType}/{entityId}/keys/attributes/{scope}", method = RequestMethod.GET) |
|
|
|
@ResponseBody |
|
|
|
public DeferredResult<ResponseEntity> getAttributeKeysByScope( |
|
|
|
@PathVariable("entityType") String entityType, @PathVariable("entityId") String entityIdStr |
|
|
|
@ -133,7 +133,7 @@ public class TelemetryController extends BaseController { |
|
|
|
} |
|
|
|
|
|
|
|
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')") |
|
|
|
@RequestMapping(value = "/{entityType}/{entityId}/values/ATTRIBUTES", method = RequestMethod.GET) |
|
|
|
@RequestMapping(value = "/{entityType}/{entityId}/values/attributes", method = RequestMethod.GET) |
|
|
|
@ResponseBody |
|
|
|
public DeferredResult<ResponseEntity> getAttributes( |
|
|
|
@PathVariable("entityType") String entityType, @PathVariable("entityId") String entityIdStr, |
|
|
|
@ -144,7 +144,7 @@ public class TelemetryController extends BaseController { |
|
|
|
} |
|
|
|
|
|
|
|
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')") |
|
|
|
@RequestMapping(value = "/{entityType}/{entityId}/values/ATTRIBUTES/{scope}", method = RequestMethod.GET) |
|
|
|
@RequestMapping(value = "/{entityType}/{entityId}/values/attributes/{scope}", method = RequestMethod.GET) |
|
|
|
@ResponseBody |
|
|
|
public DeferredResult<ResponseEntity> getAttributesByScope( |
|
|
|
@PathVariable("entityType") String entityType, @PathVariable("entityId") String entityIdStr, |
|
|
|
@ -156,7 +156,7 @@ public class TelemetryController extends BaseController { |
|
|
|
} |
|
|
|
|
|
|
|
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')") |
|
|
|
@RequestMapping(value = "/{entityType}/{entityId}/keys/TIMESERIES", method = RequestMethod.GET) |
|
|
|
@RequestMapping(value = "/{entityType}/{entityId}/keys/timeseries", method = RequestMethod.GET) |
|
|
|
@ResponseBody |
|
|
|
public DeferredResult<ResponseEntity> getTimeseriesKeys( |
|
|
|
@PathVariable("entityType") String entityType, @PathVariable("entityId") String entityIdStr) throws ThingsboardException { |
|
|
|
@ -167,7 +167,7 @@ public class TelemetryController extends BaseController { |
|
|
|
} |
|
|
|
|
|
|
|
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')") |
|
|
|
@RequestMapping(value = "/{entityType}/{entityId}/values/TIMESERIES", method = RequestMethod.GET) |
|
|
|
@RequestMapping(value = "/{entityType}/{entityId}/values/timeseries", method = RequestMethod.GET) |
|
|
|
@ResponseBody |
|
|
|
public DeferredResult<ResponseEntity> getLatestTimeseries( |
|
|
|
@PathVariable("entityType") String entityType, @PathVariable("entityId") String entityIdStr, |
|
|
|
@ -180,7 +180,7 @@ public class TelemetryController extends BaseController { |
|
|
|
|
|
|
|
|
|
|
|
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')") |
|
|
|
@RequestMapping(value = "/{entityType}/{entityId}/values/TIMESERIES", method = RequestMethod.GET) |
|
|
|
@RequestMapping(value = "/{entityType}/{entityId}/values/timeseries", method = RequestMethod.GET, params = {"keys", "startTs", "endTs"}) |
|
|
|
@ResponseBody |
|
|
|
public DeferredResult<ResponseEntity> getTimeseries( |
|
|
|
@PathVariable("entityType") String entityType, @PathVariable("entityId") String entityIdStr, |
|
|
|
@ -222,7 +222,7 @@ public class TelemetryController extends BaseController { |
|
|
|
} |
|
|
|
|
|
|
|
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')") |
|
|
|
@RequestMapping(value = "/{entityType}/{entityId}/ATTRIBUTES/{scope}", method = RequestMethod.POST) |
|
|
|
@RequestMapping(value = "/{entityType}/{entityId}/attributes/{scope}", method = RequestMethod.POST) |
|
|
|
@ResponseBody |
|
|
|
public DeferredResult<ResponseEntity> saveEntityAttributesV2(@PathVariable("entityType") String entityType, @PathVariable("entityId") String entityIdStr, |
|
|
|
@PathVariable("scope") String scope, |
|
|
|
@ -232,7 +232,7 @@ public class TelemetryController extends BaseController { |
|
|
|
} |
|
|
|
|
|
|
|
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')") |
|
|
|
@RequestMapping(value = "/{entityType}/{entityId}/TIMESERIES/{scope}", method = RequestMethod.POST) |
|
|
|
@RequestMapping(value = "/{entityType}/{entityId}/timeseries/{scope}", method = RequestMethod.POST) |
|
|
|
@ResponseBody |
|
|
|
public DeferredResult<ResponseEntity> saveEntityTelemetry(@PathVariable("entityType") String entityType, @PathVariable("entityId") String entityIdStr, |
|
|
|
@PathVariable("scope") String scope, |
|
|
|
@ -242,7 +242,7 @@ public class TelemetryController extends BaseController { |
|
|
|
} |
|
|
|
|
|
|
|
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')") |
|
|
|
@RequestMapping(value = "/{entityType}/{entityId}/TIMESERIES/{scope}/{ttl}", method = RequestMethod.POST) |
|
|
|
@RequestMapping(value = "/{entityType}/{entityId}/timeseries/{scope}/{ttl}", method = RequestMethod.POST) |
|
|
|
@ResponseBody |
|
|
|
public DeferredResult<ResponseEntity> saveEntityTelemetryWithTTL(@PathVariable("entityType") String entityType, @PathVariable("entityId") String entityIdStr, |
|
|
|
@PathVariable("scope") String scope, @PathVariable("ttl") Long ttl, |
|
|
|
|