@ -80,8 +79,7 @@ public class OtaPackageController extends BaseController {
@ApiOperation(value="Download OTA Package (downloadOtaPackage)",notes="Download OTA Package based on the provided OTA Package Id."+TENANT_AUTHORITY_PARAGRAPH)
@ApiOperation(value="Download OTA Package (downloadOtaPackage)",notes="Download OTA Package based on the provided OTA Package Id."+TENANT_AUTHORITY_PARAGRAPH)
@ -314,10 +303,10 @@ public class TelemetryController extends BaseController {
@Parameter(description="A string value representing the timezone that will be used to calculate exact timestamps for 'WEEK', 'WEEK_ISO', 'MONTH' and 'QUARTER' interval types.")
@Parameter(description="A string value representing the timezone that will be used to calculate exact timestamps for 'WEEK', 'WEEK_ISO', 'MONTH' and 'QUARTER' interval types.")
@ApiResponse(responseCode="401",description="User is not authorized to save device attributes for selected device. Most likely, User belongs to different Customer or Tenant."),
@ApiResponse(responseCode="401",description="User is not authorized to save device attributes for selected device. Most likely, User belongs to different Customer or Tenant."),
@ApiResponse(responseCode="500",description="The exception was thrown during processing the request. "+
@ApiResponse(responseCode="500",description="The exception was thrown during processing the request. "+
"Platform creates an audit log event about device attributes updates with action type 'ATTRIBUTES_UPDATED' that includes an error stacktrace."),
"Platform creates an audit log event about device attributes updates with action type 'ATTRIBUTES_UPDATED' that includes an error stacktrace."),
@ -460,11 +454,11 @@ public class TelemetryController extends BaseController {
TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH)
TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH)
@ApiResponses(value={
@ApiResponses(value={
@ApiResponse(responseCode="200",description="Time series for the selected keys in the request was removed. "+
@ApiResponse(responseCode="200",description="Time series for the selected keys in the request was removed. "+
"Platform creates an audit log event about entity time series removal with action type 'TIMESERIES_DELETED'."),
"Platform creates an audit log event about entity time series removal with action type 'TIMESERIES_DELETED'."),
@ApiResponse(responseCode="400",description="Platform returns a bad request in case if keys list is empty or start and end timestamp values is empty when deleteAllDataForKeys is set to false."),
@ApiResponse(responseCode="400",description="Platform returns a bad request in case if keys list is empty or start and end timestamp values is empty when deleteAllDataForKeys is set to false."),
@ApiResponse(responseCode="401",description="User is not authorized to delete entity time series for selected entity. Most likely, User belongs to different Customer or Tenant."),
@ApiResponse(responseCode="401",description="User is not authorized to delete entity time series for selected entity. Most likely, User belongs to different Customer or Tenant."),
@ApiResponse(responseCode="500",description="The exception was thrown during processing the request. "+
@ApiResponse(responseCode="500",description="The exception was thrown during processing the request. "+
"Platform creates an audit log event about entity time series removal with action type 'TIMESERIES_DELETED' that includes an error stacktrace."),
"Platform creates an audit log event about entity time series removal with action type 'TIMESERIES_DELETED' that includes an error stacktrace."),
@ -541,11 +535,11 @@ public class TelemetryController extends BaseController {
"Referencing a non-existing Device Id will cause an error"+TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH)
"Referencing a non-existing Device Id will cause an error"+TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH)
@ApiResponses(value={
@ApiResponses(value={
@ApiResponse(responseCode="200",description="Device attributes was removed for the selected keys in the request. "+
@ApiResponse(responseCode="200",description="Device attributes was removed for the selected keys in the request. "+
"Platform creates an audit log event about device attributes removal with action type 'ATTRIBUTES_DELETED'."),
"Platform creates an audit log event about device attributes removal with action type 'ATTRIBUTES_DELETED'."),
@ApiResponse(responseCode="400",description="Platform returns a bad request in case if keys or scope are not specified."),
@ApiResponse(responseCode="400",description="Platform returns a bad request in case if keys or scope are not specified."),
@ApiResponse(responseCode="401",description="User is not authorized to delete device attributes for selected entity. Most likely, User belongs to different Customer or Tenant."),
@ApiResponse(responseCode="401",description="User is not authorized to delete device attributes for selected entity. Most likely, User belongs to different Customer or Tenant."),
@ApiResponse(responseCode="500",description="The exception was thrown during processing the request. "+
@ApiResponse(responseCode="500",description="The exception was thrown during processing the request. "+
"Platform creates an audit log event about device attributes removal with action type 'ATTRIBUTES_DELETED' that includes an error stacktrace."),
"Platform creates an audit log event about device attributes removal with action type 'ATTRIBUTES_DELETED' that includes an error stacktrace."),
@ApiResponse(responseCode="200",description="Entity attributes was removed for the selected keys in the request. "+
@ApiResponse(responseCode="200",description="Entity attributes was removed for the selected keys in the request. "+
"Platform creates an audit log event about entity attributes removal with action type 'ATTRIBUTES_DELETED'."),
"Platform creates an audit log event about entity attributes removal with action type 'ATTRIBUTES_DELETED'."),
@ApiResponse(responseCode="400",description="Platform returns a bad request in case if keys or scope are not specified."),
@ApiResponse(responseCode="400",description="Platform returns a bad request in case if keys or scope are not specified."),
@ApiResponse(responseCode="401",description="User is not authorized to delete entity attributes for selected entity. Most likely, User belongs to different Customer or Tenant."),
@ApiResponse(responseCode="401",description="User is not authorized to delete entity attributes for selected entity. Most likely, User belongs to different Customer or Tenant."),
@ApiResponse(responseCode="500",description="The exception was thrown during processing the request. "+
@ApiResponse(responseCode="500",description="The exception was thrown during processing the request. "+
"Platform creates an audit log event about entity attributes removal with action type 'ATTRIBUTES_DELETED' that includes an error stacktrace."),
"Platform creates an audit log event about entity attributes removal with action type 'ATTRIBUTES_DELETED' that includes an error stacktrace."),
Stringmessage=String.format("String value length [%d] for key [%s] is greater than maximum allowed [%d]",entry.getValue().textValue().length(),key,maxStringValueLength);
@Query("SELECT new OtaPackageInfoEntity(f.id, f.createdTime, f.tenantId, f.deviceProfileId, f.type, f.title, f.version, f.tag, f.url, f.fileName, f.contentType, f.checksumAlgorithm, f.checksum, f.dataSize, f.additionalInfo, CASE WHEN (f.data IS NOT NULL OR f.url IS NOT NULL) THEN true ELSE false END) FROM OtaPackageEntity f WHERE "+
@Query("SELECT new OtaPackageInfoEntity(f.id, f.createdTime, f.tenantId, f.deviceProfileId, f.type, f.title, f.version, f.tag, f.url, f.fileName, f.contentType, f.checksumAlgorithm, f.checksum, f.dataSize, f.additionalInfo, f.externalId, CASE WHEN (f.data IS NOT NULL OR f.url IS NOT NULL) THEN true ELSE false END) FROM OtaPackageEntity f WHERE "+
"f.tenantId = :tenantId "+
"f.tenantId = :tenantId "+
"AND (:searchText IS NULL OR ilike(f.title, CONCAT('%', :searchText, '%')) = true)")
"AND (:searchText IS NULL OR ilike(f.title, CONCAT('%', :searchText, '%')) = true)")
@Query("SELECT new OtaPackageInfoEntity(f.id, f.createdTime, f.tenantId, f.deviceProfileId, f.type, f.title, f.version, f.tag, f.url, f.fileName, f.contentType, f.checksumAlgorithm, f.checksum, f.dataSize, f.additionalInfo, true) FROM OtaPackageEntity f WHERE "+
@Query("SELECT new OtaPackageInfoEntity(f.id, f.createdTime, f.tenantId, f.deviceProfileId, f.type, f.title, f.version, f.tag, f.url, f.fileName, f.contentType, f.checksumAlgorithm, f.checksum, f.dataSize, f.additionalInfo, f.externalId, true) FROM OtaPackageEntity f WHERE "+
"f.tenantId = :tenantId "+
"f.tenantId = :tenantId "+
"AND f.deviceProfileId = :deviceProfileId "+
"AND f.deviceProfileId = :deviceProfileId "+
"AND f.type = :type "+
"AND f.type = :type "+
@ -45,7 +46,7 @@ public interface OtaPackageInfoRepository extends JpaRepository<OtaPackageInfoEn
@Param("searchText")StringsearchText,
@Param("searchText")StringsearchText,
Pageablepageable);
Pageablepageable);
@Query("SELECT new OtaPackageInfoEntity(f.id, f.createdTime, f.tenantId, f.deviceProfileId, f.type, f.title, f.version, f.tag, f.url, f.fileName, f.contentType, f.checksumAlgorithm, f.checksum, f.dataSize, f.additionalInfo, CASE WHEN (f.data IS NOT NULL OR f.url IS NOT NULL) THEN true ELSE false END) FROM OtaPackageEntity f WHERE f.id = :id")
@Query("SELECT new OtaPackageInfoEntity(f.id, f.createdTime, f.tenantId, f.deviceProfileId, f.type, f.title, f.version, f.tag, f.url, f.fileName, f.contentType, f.checksumAlgorithm, f.checksum, f.dataSize, f.additionalInfo, f.externalId, CASE WHEN (f.data IS NOT NULL OR f.url IS NOT NULL) THEN true ELSE false END) FROM OtaPackageEntity f WHERE f.id = :id")