publicstaticfinalStringSYS_ADMIN_AUTHORITY_ONLY=" Available for users with System Administrator ('SYS_ADMIN') authority only.";
@Autowired
privateMailServicemailService;
@ -63,7 +64,7 @@ public class AdminController extends BaseController {
privateUpdateServiceupdateService;
@ApiOperation(value="Get the Administration Settings object using key (getAdminSettings)",
notes="Get the Administration Settings object using specified string key. Referencing non-existing key will cause an error."+SYS_ADMIN_AUTHORITY_ONLY)
notes="Get the Administration Settings object using specified string key. Referencing non-existing key will cause an error."+SYSTEM_AUTHORITY_PARAGRAPH)
AdminSettingsadminSettings=checkNotNull(adminSettingsService.findAdminSettingsByKey(TenantId.SYS_TENANT_ID,key),"No Administration settings found for key: "+key);
@ -86,7 +87,7 @@ public class AdminController extends BaseController {
@ApiOperation(value="Get the Administration Settings object using key (getAdminSettings)",
notes="Creates or Updates the Administration Settings. Platform generates random Administration Settings Id during settings creation. "+
"The Administration Settings Id will be present in the response. Specify the Administration Settings Id when you would like to update the Administration Settings. "+
"Referencing non-existing Administration Settings Id will cause an error."+SYS_ADMIN_AUTHORITY_ONLY)
"Referencing non-existing Administration Settings Id will cause an error."+SYSTEM_AUTHORITY_PARAGRAPH)
privatestaticfinalStringALARM_SECURITY_CHECK="If the user has the authority of 'Tenant Administrator', the server checks that the originator of alarm is owned by the same tenant. "+
"If the user has the authority of 'Customer User', the server checks that the originator of alarm belongs to the customer. ";
privatestaticfinalStringALARM_QUERY_SEARCH_STATUS_DESCRIPTION="A string value representing one of the AlarmSearchStatus enumeration value";
privatestaticfinalStringALARM_QUERY_TEXT_SEARCH_DESCRIPTION="The case insensitive 'startsWith' filter based on of next alarm fields: type, severity or status";
privatestaticfinalStringALARM_QUERY_START_TIME_DESCRIPTION="The start timestamp in milliseconds of the search time range over the Alarm class field: 'createdTime'.";
privatestaticfinalStringALARM_QUERY_END_TIME_DESCRIPTION="The end timestamp in milliseconds of the search time range over the Alarm class field: 'createdTime'.";
privatestaticfinalStringALARM_QUERY_FETCH_ORIGINATOR_DESCRIPTION="A boolean value to specify if the alarm originator name will be "+
"filled in the AlarmInfo object field: 'originatorName' or will returns as null.";
@ApiOperation(value="Create or update Alarm (saveAlarm)",
notes="Creates or Updates the Alarm. "+
"When creating alarm, platform generates Alarm Id as "+UUID_WIKI_LINK+
"The newly created Alarm id will be present in the response. Specify existing Alarm id to update the alarm. "+
"Referencing non-existing Alarm Id will cause 'Not Found' error. "+
"\n\nPlatform also deduplicate the alarms based on the entity id of originator and alarm 'type'. "+
"For example, if the user or system component create the alarm with the type 'HighTemperature' for device 'Device A' the new active alarm is created. "+
"If the user tries to create 'HighTemperature' alarm for the same device again, the previous alarm will be updated (the 'end_ts' will be set to current timestamp). "+
"If the user clears the alarm (see 'Clear Alarm(clearAlarm)'), than new alarm with the same type and same device may be created. "+TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH
notes="Deletes the Alarm. Referencing non-existing Alarm Id will cause an error."+TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH,produces=MediaType.APPLICATION_JSON_VALUE)
notes="Returns a page of alarms for the selected entity. Specifying both parameters 'searchStatus' and 'status' at the same time will cause an error. "+
notes="Search the alarms by originator ('entityType' and entityId') and optional 'status' or 'searchStatus' filters and returns the highest AlarmSeverity(CRITICAL, MAJOR, MINOR, WARNING or INDETERMINATE). "+
"Specifying both parameters 'searchStatus' and 'status' at the same time will cause an error."+TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH
@ -80,7 +101,8 @@ public class AssetController extends BaseController {
@ApiOperation(value="Get Asset (getAssetById)",
notes="Fetch the Asset object based on the provided Asset Id. "+
"If the user has the authority of 'Tenant Administrator', the server checks that the asset is owned by the same tenant. "+
"If the user has the authority of 'Customer User', the server checks that the asset is assigned to the same customer.",produces=MediaType.APPLICATION_JSON_VALUE)
"If the user has the authority of 'Customer User', the server checks that the asset is assigned to the same customer."+TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH
@ -98,7 +120,8 @@ public class AssetController extends BaseController {
@ApiOperation(value="Get Asset Info (getAssetInfoById)",
notes="Fetch the Asset Info object based on the provided Asset Id. "+
"If the user has the authority of 'Tenant Administrator', the server checks that the asset is owned by the same tenant. "+
"If the user has the authority of 'Customer User', the server checks that the asset is assigned to the same customer. "+ASSET_INFO_DESCRIPTION,produces=MediaType.APPLICATION_JSON_VALUE)
"If the user has the authority of 'Customer User', the server checks that the asset is assigned to the same customer. "
@ -114,10 +137,10 @@ public class AssetController extends BaseController {
}
@ApiOperation(value="Create Or Update Asset (saveAsset)",
notes="Creates or Updates the Asset. When creating asset, platform generates Asset Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address) "+
notes="Creates or Updates the Asset. When creating asset, platform generates Asset Id as "+UUID_WIKI_LINK+
"The newly created Asset id will be present in the response. "+
"Specify existing Asset id to update the asset. "+
"Referencing non-existing Asset Id will cause 'Not Found' error.",produces=MediaType.APPLICATION_JSON_VALUE)
"Referencing non-existing Asset Id will cause 'Not Found' error."+TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH,produces=MediaType.APPLICATION_JSON_VALUE)
@ -158,7 +181,7 @@ public class AssetController extends BaseController {
}
@ApiOperation(value="Delete asset (deleteAsset)",
notes="Deletes the asset and all the relations (from and to the asset). Referencing non-existing asset Id will cause an error.")
notes="Deletes the asset and all the relations (from and to the asset). Referencing non-existing asset Id will cause an error."+TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH)
@ -187,7 +210,7 @@ public class AssetController extends BaseController {
}
@ApiOperation(value="Assign asset to customer (assignAssetToCustomer)",
notes="Creates assignment of the asset to customer. Customer will be able to query asset afterwards.",produces=MediaType.APPLICATION_JSON_VALUE)
notes="Creates assignment of the asset to customer. Customer will be able to query asset afterwards."+TENANT_AUTHORITY_PARAGRAPH,produces=MediaType.APPLICATION_JSON_VALUE)
@ -223,7 +246,7 @@ public class AssetController extends BaseController {
}
@ApiOperation(value="Unassign asset from customer (unassignAssetFromCustomer)",
notes="Clears assignment of the asset to customer. Customer will not be able to query asset afterwards.",produces=MediaType.APPLICATION_JSON_VALUE)
notes="Clears assignment of the asset to customer. Customer will not be able to query asset afterwards."+TENANT_AUTHORITY_PARAGRAPH,produces=MediaType.APPLICATION_JSON_VALUE)
@ -261,7 +284,7 @@ public class AssetController extends BaseController {
@ApiOperation(value="Make asset publicly available (assignAssetToPublicCustomer)",
notes="Asset will be available for non-authorized (not logged-in) users. "+
"This is useful to create dashboards that you plan to share/embed on a publicly available website. "+
"However, users that are logged-in and belong to different tenant will not be able to access the asset.",produces=MediaType.APPLICATION_JSON_VALUE)
"However, users that are logged-in and belong to different tenant will not be able to access the asset."+TENANT_AUTHORITY_PARAGRAPH,produces=MediaType.APPLICATION_JSON_VALUE)
notes="Requested asset must be owned by tenant that the user belongs to. "+
"Asset name is an unique property of asset. So it can be used to identify the asset.",produces=MediaType.APPLICATION_JSON_VALUE)
"Asset name is an unique property of asset. So it can be used to identify the asset."+TENANT_AUTHORITY_PARAGRAPH,produces=MediaType.APPLICATION_JSON_VALUE)
@ -518,8 +541,11 @@ public class AssetController extends BaseController {
@ApiOperation(value="Assign asset to edge (assignAssetToEdge)",
notes="Creates assignment of an existing asset to an instance of The Edge. "+
"The Edge is a software product for edge computing. "+
"It allows bringing data analysis and management to the edge, while seamlessly synchronizing with the platform server (cloud). ",produces=MediaType.APPLICATION_JSON_VALUE)
EDGE_ASSIGN_ASYNC_FIRST_STEP_DESCRIPTION+
"Second, remote edge service will receive a copy of assignment asset "+
EDGE_ASSIGN_RECEIVE_STEP_DESCRIPTION+
"Third, once asset will be delivered to edge service, it's going to be available for usage on remote edge instance.",
privatestaticfinalStringAUDIT_LOG_QUERY_START_TIME_DESCRIPTION="The start timestamp in milliseconds of the search time range over the AuditLog class field: 'createdTime'.";
privatestaticfinalStringAUDIT_LOG_QUERY_END_TIME_DESCRIPTION="The end timestamp in milliseconds of the search time range over the AuditLog class field: 'createdTime'.";
privatestaticfinalStringAUDIT_LOG_QUERY_ACTION_TYPES_DESCRIPTION="A String value representing comma-separated list of action types. "+
"This parameter is optional, but it can be used to filter results to fetch only audit logs of specific action types. "+
"For example, 'LOGIN', 'LOGOUT'. See the 'Model' tab of the Response Class for more details.";
privatestaticfinalStringAUDIT_LOG_SORT_PROPERTY_DESCRIPTION="Property of audit log to sort by. "+
"See the 'Model' tab of the Response Class for more details. "+
"Note: entityType sort property is not defined in the AuditLog class, however, it can be used to sort audit logs by types of entities that were logged.";
@ApiOperation(value="Get audit logs by customer id (getAuditLogsByCustomerId)",
notes="Returns a page of audit logs related to the targeted customer entities (devices, assets, etc.), "+
"and users actions (login, logout, etc.) that belong to this customer. "+
@ -155,50 +157,6 @@ public abstract class BaseController {
/*Swagger UI description*/
publicstaticfinalStringCUSTOMER_ID="customerId";
publicstaticfinalStringTENANT_ID="tenantId";
publicstaticfinalStringPAGE_DATA_PARAMETERS="You can specify parameters to filter the results. "+
"The result is wrapped with PageData object that allows you to iterate over result set using pagination. "+
"See the 'Model' tab of the Response Class for more details. ";
publicstaticfinalStringDASHBOARD_ID_PARAM_DESCRIPTION="A string value representing the device id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'";
publicstaticfinalStringDEVICE_ID_PARAM_DESCRIPTION="A string value representing the device id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'";
publicstaticfinalStringDEVICE_PROFILE_ID_DESCRIPTION="A string value representing the device profile id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'";
publicstaticfinalStringTENANT_ID_PARAM_DESCRIPTION="A string value representing the tenant id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'";
publicstaticfinalStringEDGE_ID_PARAM_DESCRIPTION="A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'";
publicstaticfinalStringCUSTOMER_ID_PARAM_DESCRIPTION="A string value representing the customer id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'";
publicstaticfinalStringASSET_ID_PARAM_DESCRIPTION="A string value representing the asset id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'";
protectedfinalStringPAGE_SIZE_DESCRIPTION="Maximum amount of entities in a one page";
protectedfinalStringPAGE_NUMBER_DESCRIPTION="Sequence number of page starting from 0";
protectedfinalStringDEVICE_TYPE_DESCRIPTION="Device type as the name of the device profile";
protectedfinalStringDEVICE_INFO_DESCRIPTION="Device Info is an extension of the default Device object that contains information about the assigned customer name and device profile name. ";
protectedfinalStringASSET_INFO_DESCRIPTION="Asset Info is an extension of the default Asset object that contains information about the assigned customer name. ";
protectedfinalStringDEVICE_NAME_DESCRIPTION="A string value representing the Device name.";
protectedfinalStringASSET_NAME_DESCRIPTION="A string value representing the Asset name.";
@ -119,10 +137,10 @@ public class CustomerController extends BaseController {
}
@ApiOperation(value="Create or update Customer (saveCustomer)",
notes="Creates or Updates the Customer. When creating customer, platform generates Customer Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address) "+
notes="Creates or Updates the Customer. When creating customer, platform generates Customer Id as "+UUID_WIKI_LINK+
"The newly created Customer Id will be present in the response. "+
"Specify existing Customer Id to update the Customer. "+
"Referencing non-existing Customer Id will cause 'Not Found' error.")
"Referencing non-existing Customer Id will cause 'Not Found' error."+TENANT_AUTHORITY_PARAGRAPH)
notes="Deletes the Customer and all customer Users. All assigned Dashboards, Assets, Devices, etc. will be unassigned but not deleted. Referencing non-existing Customer Id will cause an error.")
notes="Deletes the Customer and all customer Users. "+
"All assigned Dashboards, Assets, Devices, etc. will be unassigned but not deleted. "+
"Referencing non-existing Customer Id will cause an error."+TENANT_AUTHORITY_PARAGRAPH)
@ -75,7 +101,7 @@ public class DashboardController extends BaseController {
publicstaticfinalStringDASHBOARD_DEFINITION="The Dashboard object is a heavyweight object that contains information about the dashboard (e.g. title, image, assigned customers) and also configuration JSON (e.g. layouts, widgets, entity aliases).";
publicstaticfinalStringHIDDEN_FOR_MOBILE="Exclude dashboards that are hidden for mobile";
@Value("${dashboard.max_datapoints_limit}")
@Value("${ui.dashboard.max_datapoints_limit}")
privatelongmaxDatapointsLimit;
@ApiOperation(value="Get server time (getServerTime)",
@ -84,6 +110,7 @@ public class DashboardController extends BaseController {
@ -139,11 +167,11 @@ public class DashboardController extends BaseController {
}
@ApiOperation(value="Create Or Update Dashboard (saveDashboard)",
notes="Create or update the Dashboard. When creating dashboard, platform generates Dashboard Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)."+
notes="Create or update the Dashboard. When creating dashboard, platform generates Dashboard Id as "+UUID_WIKI_LINK+
"The newly created Dashboard id will be present in the response. "+
"Specify existing Dashboard id to update the dashboard. "+
"Referencing non-existing dashboard Id will cause 'Not Found' error. "+
"Only users with 'TENANT_ADMIN') authority may create the dashboards.",
TENANT_AUTHORITY_PARAGRAPH,
produces=MediaType.APPLICATION_JSON_VALUE,
consumes=MediaType.APPLICATION_JSON_VALUE)
@PreAuthorize("hasAuthority('TENANT_ADMIN')")
@ -177,7 +205,7 @@ public class DashboardController extends BaseController {
}
@ApiOperation(value="Delete the Dashboard (deleteDashboard)",
notes="Delete the Dashboard. Only users with 'TENANT_ADMIN') authority may delete the dashboards.")
notes="Delete the Dashboard."+TENANT_AUTHORITY_PARAGRAPH)
@ -290,7 +318,7 @@ public class DashboardController extends BaseController {
@ApiOperation(value="Update the Dashboard Customers (updateDashboardCustomers)",
notes="Updates the list of Customers that this Dashboard is assigned to. Removes previous assignments to customers that are not in the provided list. "+
"Returns the Dashboard object. Only users with 'TENANT_ADMIN') authority may assign the dashboards to customers.",
"Returns the Dashboard object. "+TENANT_AUTHORITY_PARAGRAPH,
produces=MediaType.APPLICATION_JSON_VALUE,
consumes=MediaType.APPLICATION_JSON_VALUE)
@ -365,7 +393,7 @@ public class DashboardController extends BaseController {
@ApiOperation(value="Adds the Dashboard Customers (addDashboardCustomers)",
notes="Adds the list of Customers to the existing list of assignments for the Dashboard. Keeps previous assignments to customers that are not in the provided list. "+
"Returns the Dashboard object. Only users with 'TENANT_ADMIN') authority may assign the dashboards to customers.",
"Returns the Dashboard object."+TENANT_AUTHORITY_PARAGRAPH,
produces=MediaType.APPLICATION_JSON_VALUE,
consumes=MediaType.APPLICATION_JSON_VALUE)
@PreAuthorize("hasAuthority('TENANT_ADMIN')")
@ -417,7 +445,7 @@ public class DashboardController extends BaseController {
@ApiOperation(value="Remove the Dashboard Customers (removeDashboardCustomers)",
notes="Removes the list of Customers from the existing list of assignments for the Dashboard. Keeps other assignments to customers that are not in the provided list. "+
"Returns the Dashboard object. Only users with 'TENANT_ADMIN') authority may assign the dashboards to customers.",
"Returns the Dashboard object."+TENANT_AUTHORITY_PARAGRAPH,
produces=MediaType.APPLICATION_JSON_VALUE,
consumes=MediaType.APPLICATION_JSON_VALUE)
@PreAuthorize("hasAuthority('TENANT_ADMIN')")
@ -473,7 +501,7 @@ public class DashboardController extends BaseController {
"Be aware that making the dashboard public does not mean that it automatically makes all devices and assets you use in the dashboard to be public."+
"Use [assign Asset to Public Customer](#!/asset-controller/assignAssetToPublicCustomerUsingPOST) and "+
"[assign Device to Public Customer](#!/device-controller/assignDeviceToPublicCustomerUsingPOST) for this purpose. "+
"Returns the Dashboard object. Only users with 'TENANT_ADMIN') authority may assign the dashboards to customers.",
"Returns the Dashboard object."+TENANT_AUTHORITY_PARAGRAPH,
@ -505,7 +533,7 @@ public class DashboardController extends BaseController {
@ApiOperation(value="Unassign the Dashboard from Public Customer (unassignDashboardFromPublicCustomer)",
notes="Unassigns the dashboard from a special, auto-generated 'Public' Customer. Once unassigned, unauthenticated users may no longer browse the dashboard. "+
"Returns the Dashboard object. Only users with 'TENANT_ADMIN') authority may assign the dashboards to customers.",
"Returns the Dashboard object."+TENANT_AUTHORITY_PARAGRAPH,
@ -641,8 +669,7 @@ public class DashboardController extends BaseController {
notes="Returns the home dashboard object that is configured as 'homeDashboardId' parameter in the 'additionalInfo' of the User. "+
"If 'homeDashboardId' parameter is not set on the User level and the User has authority 'CUSTOMER_USER', check the same parameter for the corresponding Customer. "+
"If 'homeDashboardId' parameter is not set on the User and Customer levels then checks the same parameter for the Tenant that owns the user. "
+DASHBOARD_DEFINITION+" "+
"Only users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority should use this method.",
@ -679,7 +706,7 @@ public class DashboardController extends BaseController {
notes="Returns the home dashboard info object that is configured as 'homeDashboardId' parameter in the 'additionalInfo' of the User. "+
"If 'homeDashboardId' parameter is not set on the User level and the User has authority 'CUSTOMER_USER', check the same parameter for the corresponding Customer. "+
"If 'homeDashboardId' parameter is not set on the User and Customer levels then checks the same parameter for the Tenant that owns the user. "+
"Only users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority should use this method.",
@ -714,7 +741,7 @@ public class DashboardController extends BaseController {
@ApiOperation(value="Get Tenant Home Dashboard Info (getTenantHomeDashboardInfo)",
notes="Returns the home dashboard info object that is configured as 'homeDashboardId' parameter in the 'additionalInfo' of the corresponding tenant. "+
"Only users with 'TENANT_ADMIN' authority may use this method.",
@ -137,11 +167,13 @@ public class DeviceController extends BaseController {
}
@ApiOperation(value="Create Or Update Device (saveDevice)",
notes="Create or update the Device. When creating device, platform generates Device Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address). "+
"Device credentials are also generated if not provided in the 'accessToken' request parameter. "+
"The newly created device id will be present in the response. "+
"Specify existing Device id to update the device. "+
"Referencing non-existing device Id will cause 'Not Found' error.")
notes="Create or update the Device. When creating device, platform generates Device Id as "+UUID_WIKI_LINK+
"Device credentials are also generated if not provided in the 'accessToken' request parameter. "+
"The newly created device id will be present in the response. "+
"Specify existing Device id to update the device. "+
"Referencing non-existing device Id will cause 'Not Found' error."+
"\n\nDevice name is unique in the scope of tenant. Use unique identifiers like MAC or IMEI for the device names and non-unique 'label' field for user-friendly visualization purposes."
notes="Deletes the device, it's credentials and all the relations (from and to the device). Referencing non-existing device Id will cause an error.")
notes="Deletes the device, it's credentials and all the relations (from and to the device). Referencing non-existing device Id will cause an error."+TENANT_AUTHORITY_PARAGRAPH)
notes="If during device creation there wasn't specified any credentials, platform generates random 'ACCESS_TOKEN' credentials.")
notes="If during device creation there wasn't specified any credentials, platform generates random 'ACCESS_TOKEN' credentials."+TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH)
"Use this method to update the device credentials. First use 'getDeviceCredentialsByDeviceId' to get the credentials id and value. "+
"Then use current method to update the credentials type and value. It is not possible to create multiple device credentials for the same device. "+
"The structure of device credentials id and value is simple for the 'ACCESS_TOKEN' but is much more complex for the 'MQTT_BASIC' or 'LWM2M_CREDENTIALS'.")
"The structure of device credentials id and value is simple for the 'ACCESS_TOKEN' but is much more complex for the 'MQTT_BASIC' or 'LWM2M_CREDENTIALS'."+TENANT_AUTHORITY_PARAGRAPH)
@ -536,7 +599,7 @@ public class DeviceController extends BaseController {
}
@ApiOperation(value="Get Devices By Ids (getDevicesByIds)",
notes="Requested devices must be owned by tenant or assigned to customer which user is performing the request. ")
notes="Requested devices must be owned by tenant or assigned to customer which user is performing the request. "+TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH)
notes="Returns a set of unique device profile names based on devices that are either owned by the tenant or assigned to the customer which user is performing the request.")
notes="Returns a set of unique device profile names based on devices that are either owned by the tenant or assigned to the customer which user is performing the request."
notes="Get a set of unique time-series keys used by devices that belong to specified profile. "+
"If profile is not set returns a list of unique keys among all profiles. "+
"The call is used for auto-complete in the UI forms. "+
"The implementation limits the number of devices that participate in search to 100 as a trade of between accurate results and time-consuming queries. "+
notes="Get a set of unique attribute keys used by devices that belong to specified profile. "+
"If profile is not set returns a list of unique keys among all profiles. "+
"The call is used for auto-complete in the UI forms. "+
"The implementation limits the number of devices that participate in search to 100 as a trade of between accurate results and time-consuming queries. "+
publicstaticfinalStringEDGE_SECURITY_CHECK="If the user has the authority of 'Tenant Administrator', the server checks that the edge is owned by the same tenant. "+
"If the user has the authority of 'Customer User', the server checks that the edge is assigned to the same customer.";
@ApiOperation(value="Is edges support enabled (isEdgesSupportEnabled)",
notes="Returns 'true' if edges support enabled on server, 'false' - otherwise.")
@ -117,10 +149,19 @@ public class EdgeController extends BaseController {
}
}
@ApiOperation(value="Create Or Update Edge (saveEdge)",
notes="Create or update the Edge. When creating edge, platform generates Edge Id as "+UUID_WIKI_LINK+
"The newly created edge id will be present in the response. "+
"Specify existing Edge id to update the edge. "+
"Referencing non-existing Edge Id will cause 'Not Found' error."+
"\n\nEdge name is unique in the scope of tenant. Use unique identifiers like MAC or IMEI for the edge names and non-unique 'label' field for user-friendly visualization purposes."
notes="Returns a set of unique edge types based on edges that are either owned by the tenant or assigned to the customer which user is performing the request."
notes="Returns list of rule chains ids that are not assigned to particular edge, but these rule chains are present in the already assigned rule chains to edge."+TENANT_AUTHORITY_PARAGRAPH)
@ -83,12 +98,18 @@ public class EntityQueryController extends BaseController {
}
}
@ApiOperation(value="Find Entity Keys by Query",
notes="Uses entity data query (see 'Find Entity Data by Query') to find first 100 entities. Then fetch and return all unique time-series and/or attribute keys. Used mostly for UI hints.")
privatestaticfinalStringSECURITY_CHECKS_ENTITIES_DESCRIPTION="\n\nIf the user has the authority of 'System Administrator', the server checks that 'from' and 'to' entities are owned by the sysadmin. "+
"If the user has the authority of 'Tenant Administrator', the server checks that 'from' and 'to' entities are owned by the same tenant. "+
"If the user has the authority of 'Customer User', the server checks that the 'from' and 'to' entities are assigned to the same customer.";
privatestaticfinalStringSECURITY_CHECKS_ENTITY_DESCRIPTION="\n\nIf the user has the authority of 'System Administrator', the server checks that the entity is owned by the sysadmin. "+
"If the user has the authority of 'Tenant Administrator', the server checks that the entity is owned by the same tenant. "+
"If the user has the authority of 'Customer User', the server checks that the entity is assigned to the same customer.";
@ -549,10 +647,16 @@ public class EntityViewController extends BaseController {
}
}
@ApiOperation(value="Find related entity views (findByQuery)",
notes="Returns all entity views that are related to the specific entity. "+
"The entity id, relation type, entity view types, depth of the search, and other query parameters defined using complex 'EntityViewSearchQuery' object. "+
"See 'Model' tab of the Parameters for more info."+TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH)
notes="Returns a set of unique entity view types based on entity views that are either owned by the tenant or assigned to the customer which user is performing the request."
notes="Get the Lwm2m Bootstrap SecurityInfo object (of the current server) based on the provided isBootstrapServer parameter. If isBootstrapServer == true, get the parameters of the current Bootstrap Server. If isBootstrapServer == false, get the parameters of the current Lwm2m Server. Used for client settings when starting the client in Bootstrap mode. "+
privatestaticfinalStringOAUTH2_CLIENT_REGISTRATION_TEMPLATE_DEFINITION="Client registration template is OAuth2 provider configuration template with default settings for registering new OAuth2 clients";
@ApiOperation(value="Create or update OAuth2 client registration template (saveClientRegistrationTemplate)"+SYSTEM_AUTHORITY_PARAGRAPH,
publicvoiddeleteClientRegistrationTemplate(@ApiParam(value="String representation of client registration template id to delete",example="139b1f81-2f5d-11ec-9dbe-9b627e1a88f4")
@ApiOperation(value="Download OTA Package (downloadOtaPackage)",notes="Download OTA Package based on the provided OTA Package Id."+TENANT_AUTHORITY_PARAGRAPH)
privatestaticfinalStringRPC_REQUEST_DESCRIPTION="Sends the one-way remote-procedure call (RPC) request to device. "+
"The RPC call is A JSON that contains the method name ('method'), parameters ('params') and multiple optional fields. "+
"See example below. We will review the properties of the RPC call one-by-one below. "+
"\n\n"+MARKDOWN_CODE_BLOCK_START+
"{\n"+
" \"method\": \"setGpio\",\n"+
" \"params\": {\n"+
" \"pin\": 7,\n"+
" \"value\": 1\n"+
" },\n"+
" \"persistent\": false,\n"+
" \"timeout\": 5000\n"+
"}"+
MARKDOWN_CODE_BLOCK_END+
"\n\n### Server-side RPC structure\n"+
"\n"+
"The body of server-side RPC request consists of multiple fields:\n"+
"\n"+
"* **method** - mandatory, name of the method to distinct the RPC calls.\n"+
" For example, \"getCurrentTime\" or \"getWeatherForecast\". The value of the parameter is a string.\n"+
"* **params** - mandatory, parameters used for processing of the request. The value is a JSON. Leave empty JSON \"{}\" if no parameters needed.\n"+
"* **timeout** - optional, value of the processing timeout in milliseconds. The default value is 10000 (10 seconds). The minimum value is 5000 (5 seconds).\n"+
"* **expirationTime** - optional, value of the epoch time (in milliseconds, UTC timezone). Overrides **timeout** if present.\n"+
"* **persistent** - optional, indicates persistent RPC. The default value is \"false\".\n"+
"* **retries** - optional, defines how many times persistent RPC will be re-sent in case of failures on the network and/or device side.\n"+
"* **additionalInfo** - optional, defines metadata for the persistent RPC that will be added to the persistent RPC events.";
"In case of persistent RPC, the result of this call is 'rpcId' UUID. In case of lightweight RPC, "+
"the result of this call is the response from device, or 504 Gateway Timeout if device is offline.";
privatestaticfinalStringONE_WAY_RPC_REQUEST_DESCRIPTION="Sends the one-way remote-procedure call (RPC) request to device. "+RPC_REQUEST_DESCRIPTION+ONE_WAY_RPC_RESULT+TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH;
privatestaticfinalStringTWO_WAY_RPC_REQUEST_DESCRIPTION="Sends the two-way remote-procedure call (RPC) request to device. "+RPC_REQUEST_DESCRIPTION+TWO_WAY_RPC_RESULT+TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH;
@ -79,31 +166,62 @@ public class RpcV2Controller extends AbstractRpcController {
}
}
@ApiOperation(value="Get persistent RPC requests",notes="Allows to query RPC calls for specific device using pagination."+TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH)
notes="Fetch the list of rule chains and the relation types (labels) they use to process output of the current rule chain based on the provided Rule Chain Id. "
@ -53,10 +72,12 @@ public class TbResourceController extends BaseController {
publicstaticfinalStringRESOURCE_ID="resourceId";
@ApiOperation(value="Download Resource (downloadResource)",notes="Download Resource based on the provided Resource Id."+SYSTEM_OR_TENANT_AUTHORITY_PARAGRAPH)
@ApiResponse(code=401,message="User is not authorized to save device attributes for selected device. Most likely, User belongs to different Customer or Tenant."),
@ApiResponse(code=500,message="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."),
@ApiOperation(value="Delete entity time-series data (deleteEntityTimeseries)",
notes="Delete time-series for selected entity based on entity id, entity type and keys."+
" Use 'deleteAllDataForKeys' to delete all time-series data."+
" Use 'startTs' and 'endTs' to specify time-range instead. "+
" Use 'rewriteLatestIfDeleted' to rewrite latest value (stored in separate table for performance) after deletion of the time range. "+
TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH,
produces=MediaType.APPLICATION_JSON_VALUE)
@ApiResponses(value={
@ApiResponse(code=200,message="Timeseries for the selected keys in the request was removed. "+
"Platform creates an audit log event about entity timeseries removal with action type 'TIMESERIES_DELETED'."),
@ApiResponse(code=400,message="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(code=401,message="User is not authorized to delete entity timeseries for selected entity. Most likely, User belongs to different Customer or Tenant."),
@ApiResponse(code=500,message="The exception was thrown during processing the request. "+
"Platform creates an audit log event about entity timeseries removal with action type 'TIMESERIES_DELETED' that includes an error stacktrace."),
@ApiParam(value="If the parameter is set to true, the latest telemetry will be rewritten in case that current latest value was removed, otherwise, in case that parameter is set to false the new latest value will not set.")
notes="Delete device attributes using provided Device Id, scope and a list of keys. "+
"Referencing a non-existing Device Id will cause an error"+TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH,
produces=MediaType.APPLICATION_JSON_VALUE)
@ApiResponses(value={
@ApiResponse(code=200,message="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'."),
@ApiResponse(code=400,message="Platform returns a bad request in case if keys or scope are not specified."),
@ApiResponse(code=401,message="User is not authorized to delete device attributes for selected entity. Most likely, User belongs to different Customer or Tenant."),
@ApiResponse(code=500,message="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."),
@ApiResponse(code=200,message="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'."),
@ApiResponse(code=400,message="Platform returns a bad request in case if keys or scope are not specified."),
@ApiResponse(code=401,message="User is not authorized to delete entity attributes for selected entity. Most likely, User belongs to different Customer or Tenant."),
@ApiResponse(code=500,message="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."),
notes="Deletes the tenant, it's customers, rule chains, devices and all other related entities. Referencing non-existing tenant Id will cause an error."+SYSTEM_AUTHORITY_PARAGRAPH)
@ -124,14 +165,21 @@ public class TenantController extends BaseController {
}
}
@ApiOperation(value="Get Tenants (getTenants)",notes="Returns a page of tenants registered in the platform. "+PAGE_DATA_PARAMETERS+SYSTEM_AUTHORITY_PARAGRAPH)
@ -81,10 +110,65 @@ public class TenantProfileController extends BaseController {
}
}
@ApiOperation(value="Create Or update Tenant Profile (saveTenantProfile)",
notes="Create or update the Tenant Profile. When creating tenant profile, platform generates Tenant Profile Id as "+UUID_WIKI_LINK+
"The newly created Tenant Profile Id will be present in the response. "+
"Specify existing Tenant Profile Id id to update the Tenant Profile. "+
"Referencing non-existing Tenant Profile Id will cause 'Not Found' error. "+
"\n\nUpdate of the tenant profile configuration will cause immediate recalculation of API limits for all affected Tenants. "+
"\n\nThe **'profileData'** object is the part of Tenant Profile that defines API limits and Rate limits. "+
"\n\nYou have an ability to define maximum number of devices ('maxDevice'), assets ('maxAssets') and other entities. "+
"You may also define maximum number of messages to be processed per month ('maxTransportMessages', 'maxREExecutions', etc). "+
"The '*RateLimit' defines the rate limits using simple syntax. For example, '1000:1,20000:60' means up to 1000 events per second but no more than 20000 event per minute. "+
"Let's review the example of tenant profile data below: "+
notes="Deletes the tenant profile. Referencing non-existing tenant profile Id will cause an error. Referencing profile that is used by the tenants will cause an error. "+SYSTEM_AUTHORITY_PARAGRAPH)
@ -135,14 +227,21 @@ public class TenantProfileController extends BaseController {
}
}
@ApiOperation(value="Get Tenant Profiles (getTenantProfiles)",notes="Returns a page of tenant profiles registered in the platform. "+PAGE_DATA_PARAMETERS+SYSTEM_AUTHORITY_PARAGRAPH)
@ -151,14 +250,22 @@ public class TenantProfileController extends BaseController {
}
}
@ApiOperation(value="Get Tenant Profiles Info (getTenantProfileInfos)",notes="Returns a page of tenant profile info objects registered in the platform. "
@ -112,10 +144,16 @@ public class UserController extends BaseController {
returnuserTokenAccessEnabled;
}
@ApiOperation(value="Get User Token (getUserToken)",
notes="Returns the token of the User based on the provided User Id. "+
"If the user who performs the request has the authority of 'SYS_ADMIN', it is possible to get the token of any tenant administrator. "+
"If the user who performs the request has the authority of 'TENANT_ADMIN', it is possible to get the token of any customer user that belongs to the same tenant. ")
@ -188,10 +230,13 @@ public class UserController extends BaseController {
}
}
@ApiOperation(value="Send or re-send the activation email",
notes="Force send the activation email to the user. Useful to resend the email if user has accidentally deleted it. "+SYSTEM_OR_TENANT_AUTHORITY_PARAGRAPH)
@ -331,11 +409,16 @@ public class UserController extends BaseController {
}
}
@ApiOperation(value="Enable/Disable User credentials (setUserCredentialsEnabled)",
notes="Enables or Disables user credentials. Useful when you would like to block user account without deleting it. "+PAGE_DATA_PARAMETERS+TENANT_AUTHORITY_PARAGRAPH)
privatestaticfinalStringWIDGET_TYPE_DESCRIPTION="Widget Type represents the template for widget creation. Widget Type and Widget are similar to class and object in OOP theory.";
privatestaticfinalStringWIDGET_TYPE_DETAILS_DESCRIPTION="Widget Type Details extend Widget Type and add image and description properties. "+
"Those properties are useful to edit the Widget Type but they are not required for Dashboard rendering. ";
privatestaticfinalStringWIDGET_TYPE_INFO_DESCRIPTION="Widget Type Info is a lightweight object that represents Widget Type but does not contain the heavyweight widget descriptor JSON";
@ApiOperation(value="Get Widget Type Details (getWidgetTypeById)",
notes="Get the Widget Type Details based on the provided Widget Type Id. "+WIDGET_TYPE_DETAILS_DESCRIPTION+SYSTEM_OR_TENANT_AUTHORITY_PARAGRAPH)
@ -101,11 +132,15 @@ public class WidgetTypeController extends BaseController {
}
}
@ApiOperation(value="Get all Widget types for specified Bundle (getBundleWidgetTypes)",
notes="Returns an array of Widget Type objects that belong to specified Widget Bundle."+WIDGET_TYPE_DESCRIPTION+" "+SYSTEM_OR_TENANT_AUTHORITY_PARAGRAPH)
@ -120,11 +155,15 @@ public class WidgetTypeController extends BaseController {
}
}
@ApiOperation(value="Get all Widget types details for specified Bundle (getBundleWidgetTypes)",
notes="Returns an array of Widget Type Details objects that belong to specified Widget Bundle."+WIDGET_TYPE_DETAILS_DESCRIPTION+" "+SYSTEM_OR_TENANT_AUTHORITY_PARAGRAPH)
privatestaticfinalStringWIDGET_BUNDLE_DESCRIPTION="Widget Bundle represents a group(bundle) of widgets. Widgets are grouped into bundle by type or use case. ";
@ -57,10 +78,21 @@ public class WidgetsBundleController extends BaseController {
}
}
@ApiOperation(value="Create Or Update Widget Bundle (saveWidgetsBundle)",
notes="Create or update the Widget Bundle. "+WIDGET_BUNDLE_DESCRIPTION+" "+
"When creating the bundle, platform generates Widget Bundle Id as "+UUID_WIKI_LINK+
"The newly created Widget Bundle Id will be present in the response. "+
"Specify existing Widget Bundle id to update the Widget Bundle. "+
"Referencing non-existing Widget Bundle Id will cause 'Not Found' error."+
"\n\nWidget Bundle alias is unique in the scope of tenant. "+
"Special Tenant Id '13814000-1dd2-11b2-8080-808080808080' is automatically used if the create bundle request is sent by user with 'SYS_ADMIN' authority."
@ -119,6 +163,8 @@ public class WidgetsBundleController extends BaseController {
}
}
@ApiOperation(value="Get all Widget Bundles (getWidgetsBundles)",
notes="Returns an array of Widget Bundle objects that are available for current user."+WIDGET_BUNDLE_DESCRIPTION+" "+AVAILABLE_FOR_ANY_AUTHORIZED_USER)
log.warn("[{}][{}] Can't automatically rename the label from [{}] to [{}] due to conflict [{}]",tenantId,ruleChainId,oldLabel,newLabel,updatedLabels.get(oldLabel));
}else{
updatedLabels.put(oldLabel,newLabel);
}
}
}catch(Exceptione){
log.warn("[{}][{}][{}] Failed to decode rule node configuration",tenantId,ruleChainId,newNode.getId(),e);
}
}
}
// Remove all output labels that are renamed to two or more different labels, since we don't which new label to use;
confusedLabels.forEach(updatedLabels::remove);
// Remove all output labels that are renamed but still present in the rule chain;
# Optional alias of the private key; If not set, the platform will load the first private key from the keystore;
key_alias:"${MQTT_SSL_KEY_ALIAS:}"
# Optional password to access the private key. If not set, the platform will attempt to load the private keys that are not protected with the password;
description:"${SWAGGER_DESCRIPTION:For instructions how to authorize requests please visit <a href='http://thingsboard.io/docs/reference/rest-api/'>REST API documentation page</a>.}"
description:"${SWAGGER_DESCRIPTION: ThingsBoard open-source IoT platform REST API documentation.}"
type:"${TB_QUEUE_TYPE:in-memory}"# in-memory or kafka (Apache Kafka) or aws-sqs (AWS SQS) or pubsub (PubSub) or service-bus (Azure Service Bus) or rabbitmq (RabbitMQ)
# Key-value properties for Kafka consumer per specific topic, e.g. tb_ota_package is a topic name for ota, tb_rule_engine.sq is a topic name for default SequentialByOriginator queue.
# Check TB_QUEUE_CORE_OTA_TOPIC and TB_QUEUE_RE_SQ_TOPIC params
other:# In this section you can specify custom parameters for Kafka consumer/producer and expose the env variables to configure outside
- key:"request.timeout.ms"# refer to https://docs.confluent.io/platform/current/installation/configuration/producer-configs.html#producerconfigs_request.timeout.ms
# For RETRY_ALL, RETRY_FAILED, RETRY_TIMED_OUT, RETRY_FAILED_AND_TIMED_OUT
retries:"${TB_QUEUE_RE_MAIN_PROCESSING_STRATEGY_RETRIES:3}"# Number of retries, 0 is unlimited
failure-percentage:"${TB_QUEUE_RE_MAIN_PROCESSING_STRATEGY_FAILURE_PERCENTAGE:0}"# Skip retry if failures or timeouts are less then X percentage of messages;
pause-between-retries:"${TB_QUEUE_RE_MAIN_PROCESSING_STRATEGY_RETRY_PAUSE:3}"# Time in seconds to wait in consumer thread before retries;
max-pause-between-retries:"${TB_QUEUE_RE_MAIN_PROCESSING_STRATEGY_MAX_RETRY_PAUSE:3}"# Max allowed time in seconds for pause between retries.
pause-between-retries:"${TB_QUEUE_RE_MAIN_PROCESSING_STRATEGY_RETRY_PAUSE:3}"# Time in seconds to wait in consumer thread before retries;
max-pause-between-retries:"${TB_QUEUE_RE_MAIN_PROCESSING_STRATEGY_MAX_RETRY_PAUSE:3}"# Max allowed time in seconds for pause between retries.
# For RETRY_ALL, RETRY_FAILED, RETRY_TIMED_OUT, RETRY_FAILED_AND_TIMED_OUT
retries:"${TB_QUEUE_RE_HP_PROCESSING_STRATEGY_RETRIES:0}"# Number of retries, 0 is unlimited
failure-percentage:"${TB_QUEUE_RE_HP_PROCESSING_STRATEGY_FAILURE_PERCENTAGE:0}"# Skip retry if failures or timeouts are less then X percentage of messages;
pause-between-retries:"${TB_QUEUE_RE_HP_PROCESSING_STRATEGY_RETRY_PAUSE:5}"# Time in seconds to wait in consumer thread before retries;
max-pause-between-retries:"${TB_QUEUE_RE_HP_PROCESSING_STRATEGY_MAX_RETRY_PAUSE:5}"# Max allowed time in seconds for pause between retries.
pause-between-retries:"${TB_QUEUE_RE_HP_PROCESSING_STRATEGY_RETRY_PAUSE:5}"# Time in seconds to wait in consumer thread before retries;
max-pause-between-retries:"${TB_QUEUE_RE_HP_PROCESSING_STRATEGY_MAX_RETRY_PAUSE:5}"# Max allowed time in seconds for pause between retries.
# For RETRY_ALL, RETRY_FAILED, RETRY_TIMED_OUT, RETRY_FAILED_AND_TIMED_OUT
retries:"${TB_QUEUE_RE_SQ_PROCESSING_STRATEGY_RETRIES:3}"# Number of retries, 0 is unlimited
failure-percentage:"${TB_QUEUE_RE_SQ_PROCESSING_STRATEGY_FAILURE_PERCENTAGE:0}"# Skip retry if failures or timeouts are less then X percentage of messages;
pause-between-retries:"${TB_QUEUE_RE_SQ_PROCESSING_STRATEGY_RETRY_PAUSE:5}"# Time in seconds to wait in consumer thread before retries;
max-pause-between-retries:"${TB_QUEUE_RE_SQ_PROCESSING_STRATEGY_MAX_RETRY_PAUSE:5}"# Max allowed time in seconds for pause between retries.
pause-between-retries:"${TB_QUEUE_RE_SQ_PROCESSING_STRATEGY_RETRY_PAUSE:5}"# Time in seconds to wait in consumer thread before retries;
max-pause-between-retries:"${TB_QUEUE_RE_SQ_PROCESSING_STRATEGY_MAX_RETRY_PAUSE:5}"# Max allowed time in seconds for pause between retries.
transport:
# For high priority notifications that require minimum latency and processing time