@ -1409,5 +1409,116 @@ public class ControllerConstants {
"As a Tenant Administrator you are able to create multiple EVs per Device or Asset and assign them to different Customers. ";
protectedstaticfinalStringENTITY_VIEW_INFO_DESCRIPTION="Entity Views Info extends the Entity View with customer title and 'is public' flag. "+ENTITY_VIEW_DESCRIPTION;
protectedstaticfinalStringATTRIBUTES_SCOPE_DESCRIPTION="A string value representing the attributes scope. For example, 'SERVER_SCOPE'.";
protectedstaticfinalStringATTRIBUTES_KEYS_DESCRIPTION="A string value representing the comma-separated list of attributes keys. For example, 'active,inactivityAlarmTime'.";
protectedstaticfinalStringATTRIBUTES_JSON_REQUEST_DESCRIPTION="A string value representing the json object. For example, '{\"key\":\"value\"}'. See API call description for more details.";
protectedstaticfinalStringTELEMETRY_KEYS_BASE_DESCRIPTION="A string value representing the comma-separated list of telemetry keys.";
protectedstaticfinalStringTELEMETRY_KEYS_DESCRIPTION=TELEMETRY_KEYS_BASE_DESCRIPTION+" If keys are not selected, the result will return all latest timeseries. For example, 'temperature,humidity'.";
protectedstaticfinalStringTELEMETRY_SCOPE_DESCRIPTION="Value is deprecated, reserved for backward compatibility and not used in the API call implementation. Specify any scope for compatibility";
protectedstaticfinalStringTELEMETRY_JSON_REQUEST_DESCRIPTION="A JSON with the telemetry values. See API call description for more details.";
protectedstaticfinalStringSTRICT_DATA_TYPES_DESCRIPTION="Enables/disables conversion of telemetry values to strings. Conversion is enabled by default. Set parameter to 'true' in order to disable the conversion.";
protectedstaticfinalStringINVALID_ENTITY_ID_OR_ENTITY_TYPE_DESCRIPTION="Referencing a non-existing entity Id or invalid entity type will cause an error. ";
protectedstaticfinalStringSAVE_ATTIRIBUTES_STATUS_OK="Attribute from the request was created or updated. ";
protectedstaticfinalStringINVALID_STRUCTURE_OF_THE_REQUEST="Invalid structure of the request";
protectedstaticfinalStringSAVE_ATTIRIBUTES_STATUS_BAD_REQUEST=INVALID_STRUCTURE_OF_THE_REQUEST+" or invalid attributes scope provided.";
protectedstaticfinalStringSAVE_ENTITY_ATTRIBUTES_STATUS_OK="Platform creates an audit log event about entity attributes updates with action type 'ATTRIBUTES_UPDATED', "+
"and also sends event msg to the rule engine with msg type 'ATTRIBUTES_UPDATED'.";
protectedstaticfinalStringSAVE_ENTITY_ATTRIBUTES_STATUS_UNAUTHORIZED="User is not authorized to save entity attributes for selected entity. Most likely, User belongs to different Customer or Tenant.";
protectedstaticfinalStringSAVE_ENTITY_ATTRIBUTES_STATUS_INTERNAL_SERVER_ERROR="The exception was thrown during processing the request. "+
"Platform creates an audit log event about entity attributes updates with action type 'ATTRIBUTES_UPDATED' that includes an error stacktrace.";
protectedstaticfinalStringSAVE_ENTITY_TIMESERIES_STATUS_OK="Timeseries from the request was created or updated. "+
"Platform creates an audit log event about entity timeseries updates with action type 'TIMESERIES_UPDATED'.";
protectedstaticfinalStringSAVE_ENTITY_TIMESERIES_STATUS_UNAUTHORIZED="User is not authorized to save entity timeseries for selected entity. Most likely, User belongs to different Customer or Tenant.";
protectedstaticfinalStringSAVE_ENTITY_TIMESERIES_STATUS_INTERNAL_SERVER_ERROR="The exception was thrown during processing the request. "+
"Platform creates an audit log event about entity timeseries updates with action type 'TIMESERIES_UPDATED' that includes an error stacktrace.";
protectedstaticfinalStringENTITY_ATTRIBUTE_SCOPES=" List of possible attribute scopes depends on the entity type: "+
"\n\n * SERVER_SCOPE - supported for all entity types;"+
"\n * CLIENT_SCOPE - supported for devices;"+
"\n * SHARED_SCOPE - supported for devices. "+"\n\n";
protectedstaticfinalStringSAVE_ATTRIBUTES_REQUEST_PAYLOAD="The request payload is a JSON object with key-value format of attributes to create or update. "+
"For example:\n\n"
+MARKDOWN_CODE_BLOCK_START
+"{\n"+
" \"stringKey\":\"value1\", \n"+
" \"booleanKey\":true, \n"+
" \"doubleKey\":42.0, \n"+
" \"longKey\":73, \n"+
" \"jsonKey\": {\n"+
" \"someNumber\": 42,\n"+
" \"someArray\": [1,2,3],\n"+
" \"someNestedObject\": {\"key\": \"value\"}\n"+
" }\n"+
"}"
+MARKDOWN_CODE_BLOCK_END+"\n";
protectedstaticfinalStringSAVE_TIMESERIES_REQUEST_PAYLOAD="The request payload is a JSON document with three possible formats:\n\n"+
"Simple format without timestamp. In such a case, current server time will be used: \n\n"+
privatestaticfinalStringATTRIBUTES_SCOPE_DESCRIPTION="A string value representing the attributes scope. For example, 'SERVER_SCOPE'.";
privatestaticfinalStringATTRIBUTES_KEYS_DESCRIPTION="A string value representing the comma-separated list of attributes keys. For example, 'active,inactivityAlarmTime'.";
privatestaticfinalStringATTRIBUTES_JSON_REQUEST_DESCRIPTION="A string value representing the json object. For example, '{\"key\":\"value\"}'";
privatestaticfinalStringATTRIBUTE_DATA_CLASS_DESCRIPTION="AttributeData class represents information regarding a particular attribute and includes the next parameters: 'lastUpdatesTs' - a long value representing the timestamp of the last attribute modification in milliseconds. 'key' - attribute key name, and 'value' - attribute value.";
privatestaticfinalStringGET_ALL_ATTRIBUTES_BASE_DESCRIPTION="Returns a JSON structure that represents a list of AttributeData class objects for the selected entity based on the specified comma-separated list of attribute key names. "+ATTRIBUTE_DATA_CLASS_DESCRIPTION;
privatestaticfinalStringGET_ALL_ATTRIBUTES_BY_SCOPE_BASE_DESCRIPTION="Returns a JSON structure that represents a list of AttributeData class objects for the selected entity based on the attributes scope selected and a comma-separated list of attribute key names. "+ATTRIBUTE_DATA_CLASS_DESCRIPTION;
privatestaticfinalStringTS_DATA_CLASS_DESCRIPTION="TsData class is a timeseries data point for specific telemetry key that includes 'value' - object value, and 'ts' - a long value representing timestamp in milliseconds for this value. ";
privatestaticfinalStringTELEMETRY_KEYS_BASE_DESCRIPTION="A string value representing the comma-separated list of telemetry keys.";
privatestaticfinalStringTELEMETRY_KEYS_DESCRIPTION=TELEMETRY_KEYS_BASE_DESCRIPTION+" If keys are not selected, the result will return all latest timeseries. For example, 'temp,humidity'.";
privatestaticfinalStringTELEMETRY_SCOPE_DESCRIPTION="Value is not used in the API call implementation. However, you need to specify whatever value cause scope is a path variable.";
privatestaticfinalStringTELEMETRY_JSON_REQUEST_DESCRIPTION="A string value representing the json object. For example, '{\"key\":\"value\"}' or '{\"ts\":1527863043000,\"values\":{\"key1\":\"value1\",\"key2\":\"value2\"}}' or [{\"ts\":1527863043000,\"values\":{\"key1\":\"value1\",\"key2\":\"value2\"}}, {\"ts\":1527863053000,\"values\":{\"key1\":\"value3\",\"key2\":\"value4\"}}]";
privatestaticfinalStringSTRICT_DATA_TYPES_DESCRIPTION="A boolean value to specify if values of selected telemetry keys will represent string values(by default) or use strict data type.";
privatestaticfinalStringINVALID_ENTITY_ID_OR_ENTITY_TYPE_DESCRIPTION="Referencing a non-existing entity Id or invalid entity type will cause an error. ";
privatestaticfinalStringSAVE_ENTITY_ATTRIBUTES_DESCRIPTION="Creates or updates the entity attributes based on entity id, entity type, specified attributes scope "+
"and request payload that represents a JSON object with key-value format of attributes to create or update. "+
"For example, '{\"temperature\": 26}'. Key is a unique parameter and cannot be overwritten. Only value can be overwritten for the key. ";
privatestaticfinalStringSAVE_ATTIRIBUTES_STATUS_OK="Attribute from the request was created or updated. ";
privatestaticfinalStringINVALID_STRUCTURE_OF_THE_REQUEST="Invalid structure of the request";
privatestaticfinalStringSAVE_ATTIRIBUTES_STATUS_BAD_REQUEST=INVALID_STRUCTURE_OF_THE_REQUEST+" or invalid attributes scope provided.";
privatestaticfinalStringSAVE_ENTITY_ATTRIBUTES_STATUS_OK="Platform creates an audit log event about entity attributes updates with action type 'ATTRIBUTES_UPDATED', "+
"and also sends event msg to the rule engine with msg type 'ATTRIBUTES_UPDATED'.";
privatestaticfinalStringSAVE_ENTITY_ATTRIBUTES_STATUS_UNAUTHORIZED="User is not authorized to save entity attributes for selected entity. Most likely, User belongs to different Customer or Tenant.";
privatestaticfinalStringSAVE_ENTITY_ATTRIBUTES_STATUS_INTERNAL_SERVER_ERROR="The exception was thrown during processing the request. "+
"Platform creates an audit log event about entity attributes updates with action type 'ATTRIBUTES_UPDATED' that includes an error stacktrace.";
privatestaticfinalStringSAVE_ENTITY_TIMESERIES_DESCRIPTION="Creates or updates the entity timeseries based on entity id, entity type "+
"and request payload that represents a JSON object with key-value or ts-values format. "+
"For example, '{\"temperature\": 26}' or '{\"ts\":1634712287000,\"values\":{\"temperature\":26, \"humidity\":87}}', "+
"or JSON array with inner objects inside of ts-values format. "+
"For example, '[{\"ts\":1634712287000,\"values\":{\"temperature\":26, \"humidity\":87}}, {\"ts\":1634712588000,\"values\":{\"temperature\":25, \"humidity\":88}}]'. "+
"The scope parameter is not used in the API call implementation but should be specified whatever value because it is used as a path variable. ";
privatestaticfinalStringSAVE_ENTITY_TIMESERIES_STATUS_OK="Timeseries from the request was created or updated. "+
"Platform creates an audit log event about entity timeseries updates with action type 'TIMESERIES_UPDATED'.";
privatestaticfinalStringSAVE_ENTITY_TIMESERIES_STATUS_UNAUTHORIZED="User is not authorized to save entity timeseries for selected entity. Most likely, User belongs to different Customer or Tenant.";
privatestaticfinalStringSAVE_ENTITY_TIMESERIES_STATUS_INTERNAL_SERVER_ERROR="The exception was thrown during processing the request. "+
"Platform creates an audit log event about entity timeseries updates with action type 'TIMESERIES_UPDATED' that includes an error stacktrace.";
@Autowired
privateTimeseriesServicetsService;
@ -173,8 +158,6 @@ public class TelemetryController extends BaseController {
notes=GET_ALL_ATTRIBUTES_BASE_DESCRIPTION+" If 'keys' parameter is omitted, AttributeData class objects will be added to the response for all existing keys of the selected entity. "+
notes="Returns a JSON structure that represents a Map, where the map key is a telemetry key name "+
"and map value - is a list of TsData class objects. "+TS_DATA_CLASS_DESCRIPTION+
"This method allows us to group original data into intervals and aggregate it using one of the aggregation methods or just limit the number of TsData objects to fetch for each key specified. "+
"See the desription of the request parameters for more details. "+
"The result can also be sorted in ascending or descending order. "
notes="Delete device attributes from the specified attributes scope based on device id and a list of keys to delete. "+
"Selected keys will be deleted only if there are exist in the specified attribute scope. Referencing a non-existing device Id will cause an error"+TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH,
notes="Delete entity attributes from the specified attributes scope based on entity id, entity type and a list of keys to delete. "+
"Selected keys will be deleted only if there are exist in the specified attribute scope."+INVALID_ENTITY_ID_OR_ENTITY_TYPE_DESCRIPTION+TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH,
notes="Delete entity attributes using provided Entity Id, scope and a list of keys. "+