Showing
14 changed files
with
30 additions
and
16 deletions
... | ... | @@ -66,6 +66,7 @@ import static org.thingsboard.server.controller.ControllerConstants.SORT_ORDER_A |
66 | 66 | import static org.thingsboard.server.controller.ControllerConstants.SORT_ORDER_DESCRIPTION; |
67 | 67 | import static org.thingsboard.server.controller.ControllerConstants.SORT_PROPERTY_DESCRIPTION; |
68 | 68 | import static org.thingsboard.server.controller.ControllerConstants.TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH; |
69 | +import static org.thingsboard.server.controller.ControllerConstants.UUID_WIKI_LINK; | |
69 | 70 | |
70 | 71 | @RestController |
71 | 72 | @TbCoreComponent |
... | ... | @@ -120,7 +121,7 @@ public class AlarmController extends BaseController { |
120 | 121 | |
121 | 122 | @ApiOperation(value = "Create or update Alarm (saveAlarm)", |
122 | 123 | notes = "Creates or Updates the Alarm. " + |
123 | - "When creating alarm, platform generates Alarm Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address). " + | |
124 | + "When creating alarm, platform generates Alarm Id as " + UUID_WIKI_LINK + | |
124 | 125 | "The newly created Alarm id will be present in the response. Specify existing Alarm id to update the alarm. " + |
125 | 126 | "Referencing non-existing Alarm Id will cause 'Not Found' error. " + |
126 | 127 | "\n\nPlatform also deduplicate the alarms based on the entity id of originator and alarm 'type'. " + | ... | ... |
... | ... | @@ -84,6 +84,7 @@ import static org.thingsboard.server.controller.ControllerConstants.SORT_ORDER_D |
84 | 84 | import static org.thingsboard.server.controller.ControllerConstants.SORT_PROPERTY_DESCRIPTION; |
85 | 85 | import static org.thingsboard.server.controller.ControllerConstants.TENANT_AUTHORITY_PARAGRAPH; |
86 | 86 | import static org.thingsboard.server.controller.ControllerConstants.TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH; |
87 | +import static org.thingsboard.server.controller.ControllerConstants.UUID_WIKI_LINK; | |
87 | 88 | import static org.thingsboard.server.controller.EdgeController.EDGE_ID; |
88 | 89 | import static org.thingsboard.server.dao.asset.BaseAssetService.TB_SERVICE_QUEUE; |
89 | 90 | |
... | ... | @@ -136,7 +137,7 @@ public class AssetController extends BaseController { |
136 | 137 | } |
137 | 138 | |
138 | 139 | @ApiOperation(value = "Create Or Update Asset (saveAsset)", |
139 | - 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) " + | |
140 | + notes = "Creates or Updates the Asset. When creating asset, platform generates Asset Id as " + UUID_WIKI_LINK + | |
140 | 141 | "The newly created Asset id will be present in the response. " + |
141 | 142 | "Specify existing Asset id to update the asset. " + |
142 | 143 | "Referencing non-existing Asset Id will cause 'Not Found' error." + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH, produces = MediaType.APPLICATION_JSON_VALUE) |
... | ... | @@ -378,9 +379,9 @@ public class AssetController extends BaseController { |
378 | 379 | notes = "Requested asset must be owned by tenant that the user belongs to. " + |
379 | 380 | "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) |
380 | 381 | @PreAuthorize("hasAuthority('TENANT_ADMIN')") |
381 | - @RequestMapping(value = "/tenant/assets", params = {"assetName"}, method = RequestMethod.GET) | |
382 | + @RequestMapping(value = "/tenant/assets/name", method = RequestMethod.GET) | |
382 | 383 | @ResponseBody |
383 | - public Asset getTenantAsset( | |
384 | + public Asset getTenantAssetByName( | |
384 | 385 | @ApiParam(value = ASSET_NAME_DESCRIPTION) |
385 | 386 | @RequestParam String assetName) throws ThingsboardException { |
386 | 387 | try { | ... | ... |
... | ... | @@ -18,6 +18,7 @@ package org.thingsboard.server.controller; |
18 | 18 | public class ControllerConstants { |
19 | 19 | |
20 | 20 | protected static final String NEW_LINE = "\n\n"; |
21 | + protected static final String UUID_WIKI_LINK = "[time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address%29) "; | |
21 | 22 | protected static final int DEFAULT_PAGE_SIZE = 1000; |
22 | 23 | protected static final String ENTITY_TYPE = "entityType"; |
23 | 24 | protected static final String CUSTOMER_ID = "customerId"; | ... | ... |
... | ... | @@ -112,6 +112,7 @@ import static org.thingsboard.server.controller.ControllerConstants.SORT_PROPERT |
112 | 112 | import static org.thingsboard.server.controller.ControllerConstants.TENANT_AUTHORITY_PARAGRAPH; |
113 | 113 | import static org.thingsboard.server.controller.ControllerConstants.TENANT_ID_PARAM_DESCRIPTION; |
114 | 114 | import static org.thingsboard.server.controller.ControllerConstants.TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH; |
115 | +import static org.thingsboard.server.controller.ControllerConstants.UUID_WIKI_LINK; | |
115 | 116 | import static org.thingsboard.server.controller.EdgeController.EDGE_ID; |
116 | 117 | |
117 | 118 | @RestController |
... | ... | @@ -166,7 +167,7 @@ public class DeviceController extends BaseController { |
166 | 167 | } |
167 | 168 | |
168 | 169 | @ApiOperation(value = "Create Or Update Device (saveDevice)", |
169 | - 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). " + | |
170 | + notes = "Create or update the Device. When creating device, platform generates Device Id as " + UUID_WIKI_LINK + | |
170 | 171 | "Device credentials are also generated if not provided in the 'accessToken' request parameter. " + |
171 | 172 | "The newly created device id will be present in the response. " + |
172 | 173 | "Specify existing Device id to update the device. " + |
... | ... | @@ -203,7 +204,7 @@ public class DeviceController extends BaseController { |
203 | 204 | } |
204 | 205 | |
205 | 206 | @ApiOperation(value = "Create Device (saveDevice) with credentials ", |
206 | - 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). " + | |
207 | + notes = "Create or update the Device. When creating device, platform generates Device Id as " + UUID_WIKI_LINK + | |
207 | 208 | "Requires to provide the Device Credentials object as well. Useful to create device and credentials in one request. " + |
208 | 209 | "You may find the example of LwM2M device and RPK credentials below: \n\n" + |
209 | 210 | DEVICE_WITH_DEVICE_CREDENTIALS_PARAM_DESCRIPTION_MARKDOWN + | ... | ... |
... | ... | @@ -65,6 +65,7 @@ import static org.thingsboard.server.controller.ControllerConstants.SORT_PROPERT |
65 | 65 | import static org.thingsboard.server.controller.ControllerConstants.TENANT_AUTHORITY_PARAGRAPH; |
66 | 66 | import static org.thingsboard.server.controller.ControllerConstants.TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH; |
67 | 67 | import static org.thingsboard.server.controller.ControllerConstants.TRANSPORT_TYPE_ALLOWABLE_VALUES; |
68 | +import static org.thingsboard.server.controller.ControllerConstants.UUID_WIKI_LINK; | |
68 | 69 | |
69 | 70 | @RestController |
70 | 71 | @TbCoreComponent |
... | ... | @@ -186,7 +187,7 @@ public class DeviceProfileController extends BaseController { |
186 | 187 | } |
187 | 188 | |
188 | 189 | @ApiOperation(value = "Create Or Update Device Profile (saveDeviceProfile)", |
189 | - notes = "Create or update the Device Profile. When creating device profile, platform generates device profile id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address). " + | |
190 | + notes = "Create or update the Device Profile. When creating device profile, platform generates device profile id as " + UUID_WIKI_LINK + | |
190 | 191 | "The newly created device profile id will be present in the response. " + |
191 | 192 | "Specify existing device profile id to update the device profile. " + |
192 | 193 | "Referencing non-existing device profile Id will cause 'Not Found' error. " + NEW_LINE + | ... | ... |
... | ... | @@ -84,6 +84,7 @@ import static org.thingsboard.server.controller.ControllerConstants.SORT_ORDER_D |
84 | 84 | import static org.thingsboard.server.controller.ControllerConstants.SORT_PROPERTY_DESCRIPTION; |
85 | 85 | import static org.thingsboard.server.controller.ControllerConstants.TENANT_AUTHORITY_PARAGRAPH; |
86 | 86 | import static org.thingsboard.server.controller.ControllerConstants.TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH; |
87 | +import static org.thingsboard.server.controller.ControllerConstants.UUID_WIKI_LINK; | |
87 | 88 | |
88 | 89 | @RestController |
89 | 90 | @TbCoreComponent |
... | ... | @@ -149,7 +150,7 @@ public class EdgeController extends BaseController { |
149 | 150 | } |
150 | 151 | |
151 | 152 | @ApiOperation(value = "Create Or Update Edge (saveEdge)", |
152 | - notes = "Create or update the Edge. When creating edge, platform generates Edge Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address). " + | |
153 | + notes = "Create or update the Edge. When creating edge, platform generates Edge Id as " + UUID_WIKI_LINK + | |
153 | 154 | "The newly created edge id will be present in the response. " + |
154 | 155 | "Specify existing Edge id to update the edge. " + |
155 | 156 | "Referencing non-existing Edge Id will cause 'Not Found' error." + | ... | ... |
... | ... | @@ -64,6 +64,7 @@ import static org.thingsboard.server.controller.ControllerConstants.SORT_ORDER_D |
64 | 64 | import static org.thingsboard.server.controller.ControllerConstants.SORT_PROPERTY_DESCRIPTION; |
65 | 65 | import static org.thingsboard.server.controller.ControllerConstants.TENANT_AUTHORITY_PARAGRAPH; |
66 | 66 | import static org.thingsboard.server.controller.ControllerConstants.TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH; |
67 | +import static org.thingsboard.server.controller.ControllerConstants.UUID_WIKI_LINK; | |
67 | 68 | |
68 | 69 | @Slf4j |
69 | 70 | @RestController |
... | ... | @@ -138,7 +139,7 @@ public class OtaPackageController extends BaseController { |
138 | 139 | } |
139 | 140 | |
140 | 141 | @ApiOperation(value = "Create Or Update OTA Package Info (saveOtaPackageInfo)", |
141 | - notes = "Create or update the OTA Package Info. When creating OTA Package Info, platform generates OTA Package id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address). " + | |
142 | + notes = "Create or update the OTA Package Info. When creating OTA Package Info, platform generates OTA Package id as " + UUID_WIKI_LINK + | |
142 | 143 | "The newly created OTA Package id will be present in the response. " + |
143 | 144 | "Specify existing OTA Package id to update the OTA Package Info. " + |
144 | 145 | "Referencing non-existing OTA Package Id will cause 'Not Found' error. " + | ... | ... |
... | ... | @@ -101,6 +101,7 @@ import static org.thingsboard.server.controller.ControllerConstants.SORT_ORDER_A |
101 | 101 | import static org.thingsboard.server.controller.ControllerConstants.SORT_ORDER_DESCRIPTION; |
102 | 102 | import static org.thingsboard.server.controller.ControllerConstants.SORT_PROPERTY_DESCRIPTION; |
103 | 103 | import static org.thingsboard.server.controller.ControllerConstants.TENANT_AUTHORITY_PARAGRAPH; |
104 | +import static org.thingsboard.server.controller.ControllerConstants.UUID_WIKI_LINK; | |
104 | 105 | |
105 | 106 | @Slf4j |
106 | 107 | @RestController |
... | ... | @@ -186,7 +187,7 @@ public class RuleChainController extends BaseController { |
186 | 187 | } |
187 | 188 | |
188 | 189 | @ApiOperation(value = "Create Or Update Rule Chain (saveRuleChain)", |
189 | - notes = "Create or update the Rule Chain. When creating Rule Chain, platform generates Rule Chain Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address). " + | |
190 | + notes = "Create or update the Rule Chain. When creating Rule Chain, platform generates Rule Chain Id as " + UUID_WIKI_LINK + | |
190 | 191 | "The newly created Rule Chain Id will be present in the response. " + |
191 | 192 | "Specify existing Rule Chain id to update the rule chain. " + |
192 | 193 | "Referencing non-existing rule chain Id will cause 'Not Found' error." + | ... | ... |
... | ... | @@ -62,6 +62,7 @@ import static org.thingsboard.server.controller.ControllerConstants.SORT_ORDER_D |
62 | 62 | import static org.thingsboard.server.controller.ControllerConstants.SORT_PROPERTY_DESCRIPTION; |
63 | 63 | import static org.thingsboard.server.controller.ControllerConstants.SYSTEM_OR_TENANT_AUTHORITY_PARAGRAPH; |
64 | 64 | import static org.thingsboard.server.controller.ControllerConstants.TENANT_AUTHORITY_PARAGRAPH; |
65 | +import static org.thingsboard.server.controller.ControllerConstants.UUID_WIKI_LINK; | |
65 | 66 | |
66 | 67 | @Slf4j |
67 | 68 | @RestController |
... | ... | @@ -131,7 +132,7 @@ public class TbResourceController extends BaseController { |
131 | 132 | } |
132 | 133 | |
133 | 134 | @ApiOperation(value = "Create Or Update Resource (saveResource)", |
134 | - notes = "Create or update the Resource. When creating the Resource, platform generates Resource id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address). " + | |
135 | + notes = "Create or update the Resource. When creating the Resource, platform generates Resource id as " + UUID_WIKI_LINK + | |
135 | 136 | "The newly created Resource id will be present in the response. " + |
136 | 137 | "Specify existing Resource id to update the Resource. " + |
137 | 138 | "Referencing non-existing Resource Id will cause 'Not Found' error. " + | ... | ... |
... | ... | @@ -57,6 +57,7 @@ import static org.thingsboard.server.controller.ControllerConstants.TENANT_ID_PA |
57 | 57 | import static org.thingsboard.server.controller.ControllerConstants.TENANT_INFO_SORT_PROPERTY_ALLOWABLE_VALUES; |
58 | 58 | import static org.thingsboard.server.controller.ControllerConstants.TENANT_SORT_PROPERTY_ALLOWABLE_VALUES; |
59 | 59 | import static org.thingsboard.server.controller.ControllerConstants.TENANT_TEXT_SEARCH_DESCRIPTION; |
60 | +import static org.thingsboard.server.controller.ControllerConstants.UUID_WIKI_LINK; | |
60 | 61 | |
61 | 62 | @RestController |
62 | 63 | @TbCoreComponent |
... | ... | @@ -111,7 +112,7 @@ public class TenantController extends BaseController { |
111 | 112 | } |
112 | 113 | |
113 | 114 | @ApiOperation(value = "Create Or update Tenant (saveTenant)", |
114 | - notes = "Create or update the Tenant. When creating tenant, platform generates Tenant Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address). " + | |
115 | + notes = "Create or update the Tenant. When creating tenant, platform generates Tenant Id as " + UUID_WIKI_LINK + | |
115 | 116 | "Default Rule Chain and Device profile are also generated for the new tenants automatically. " + |
116 | 117 | "The newly created Tenant Id will be present in the response. " + |
117 | 118 | "Specify existing Tenant Id id to update the Tenant. " + | ... | ... |
... | ... | @@ -53,6 +53,7 @@ import static org.thingsboard.server.controller.ControllerConstants.TENANT_PROFI |
53 | 53 | import static org.thingsboard.server.controller.ControllerConstants.TENANT_PROFILE_INFO_SORT_PROPERTY_ALLOWABLE_VALUES; |
54 | 54 | import static org.thingsboard.server.controller.ControllerConstants.TENANT_PROFILE_SORT_PROPERTY_ALLOWABLE_VALUES; |
55 | 55 | import static org.thingsboard.server.controller.ControllerConstants.TENANT_PROFILE_TEXT_SEARCH_DESCRIPTION; |
56 | +import static org.thingsboard.server.controller.ControllerConstants.UUID_WIKI_LINK; | |
56 | 57 | |
57 | 58 | @RestController |
58 | 59 | @TbCoreComponent |
... | ... | @@ -110,7 +111,7 @@ public class TenantProfileController extends BaseController { |
110 | 111 | } |
111 | 112 | |
112 | 113 | @ApiOperation(value = "Create Or update Tenant Profile (saveTenantProfile)", |
113 | - notes = "Create or update the Tenant Profile. When creating tenant profile, platform generates Tenant Profile Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address). " + | |
114 | + notes = "Create or update the Tenant Profile. When creating tenant profile, platform generates Tenant Profile Id as " + UUID_WIKI_LINK + | |
114 | 115 | "The newly created Tenant Profile Id will be present in the response. " + |
115 | 116 | "Specify existing Tenant Profile Id id to update the Tenant Profile. " + |
116 | 117 | "Referencing non-existing Tenant Profile Id will cause 'Not Found' error. " + | ... | ... |
... | ... | @@ -81,6 +81,7 @@ import static org.thingsboard.server.controller.ControllerConstants.TENANT_OR_CU |
81 | 81 | import static org.thingsboard.server.controller.ControllerConstants.USER_ID_PARAM_DESCRIPTION; |
82 | 82 | import static org.thingsboard.server.controller.ControllerConstants.USER_SORT_PROPERTY_ALLOWABLE_VALUES; |
83 | 83 | import static org.thingsboard.server.controller.ControllerConstants.USER_TEXT_SEARCH_DESCRIPTION; |
84 | +import static org.thingsboard.server.controller.ControllerConstants.UUID_WIKI_LINK; | |
84 | 85 | |
85 | 86 | @RequiredArgsConstructor |
86 | 87 | @RestController |
... | ... | @@ -174,7 +175,7 @@ public class UserController extends BaseController { |
174 | 175 | } |
175 | 176 | |
176 | 177 | @ApiOperation(value = "Save Or update User (saveUser)", |
177 | - notes = "Create or update the User. When creating user, platform generates User Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address). " + | |
178 | + notes = "Create or update the User. When creating user, platform generates User Id as " + UUID_WIKI_LINK + | |
178 | 179 | "The newly created User Id will be present in the response. " + |
179 | 180 | "Specify existing User Id to update the device. " + |
180 | 181 | "Referencing non-existing User Id will cause 'Not Found' error." + | ... | ... |
... | ... | @@ -45,6 +45,7 @@ import java.util.List; |
45 | 45 | |
46 | 46 | import static org.thingsboard.server.controller.ControllerConstants.AVAILABLE_FOR_ANY_AUTHORIZED_USER; |
47 | 47 | import static org.thingsboard.server.controller.ControllerConstants.SYSTEM_OR_TENANT_AUTHORITY_PARAGRAPH; |
48 | +import static org.thingsboard.server.controller.ControllerConstants.UUID_WIKI_LINK; | |
48 | 49 | import static org.thingsboard.server.controller.ControllerConstants.WIDGET_TYPE_ID_PARAM_DESCRIPTION; |
49 | 50 | |
50 | 51 | @Slf4j |
... | ... | @@ -78,7 +79,7 @@ public class WidgetTypeController extends BaseController { |
78 | 79 | |
79 | 80 | @ApiOperation(value = "Create Or Update Widget Type (saveWidgetType)", |
80 | 81 | notes = "Create or update the Widget Type. " + WIDGET_TYPE_DESCRIPTION + " " + |
81 | - "When creating the Widget Type, platform generates Widget Type Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address). " + | |
82 | + "When creating the Widget Type, platform generates Widget Type Id as " + UUID_WIKI_LINK + | |
82 | 83 | "The newly created Widget Type Id will be present in the response. " + |
83 | 84 | "Specify existing Widget Type id to update the Widget Type. " + |
84 | 85 | "Referencing non-existing Widget Type Id will cause 'Not Found' error." + | ... | ... |
... | ... | @@ -49,6 +49,7 @@ import static org.thingsboard.server.controller.ControllerConstants.SORT_ORDER_A |
49 | 49 | import static org.thingsboard.server.controller.ControllerConstants.SORT_ORDER_DESCRIPTION; |
50 | 50 | import static org.thingsboard.server.controller.ControllerConstants.SORT_PROPERTY_DESCRIPTION; |
51 | 51 | import static org.thingsboard.server.controller.ControllerConstants.SYSTEM_OR_TENANT_AUTHORITY_PARAGRAPH; |
52 | +import static org.thingsboard.server.controller.ControllerConstants.UUID_WIKI_LINK; | |
52 | 53 | import static org.thingsboard.server.controller.ControllerConstants.WIDGET_BUNDLE_ID_PARAM_DESCRIPTION; |
53 | 54 | import static org.thingsboard.server.controller.ControllerConstants.WIDGET_BUNDLE_SORT_PROPERTY_ALLOWABLE_VALUES; |
54 | 55 | import static org.thingsboard.server.controller.ControllerConstants.WIDGET_BUNDLE_TEXT_SEARCH_DESCRIPTION; |
... | ... | @@ -79,7 +80,7 @@ public class WidgetsBundleController extends BaseController { |
79 | 80 | |
80 | 81 | @ApiOperation(value = "Create Or Update Widget Bundle (saveWidgetsBundle)", |
81 | 82 | notes = "Create or update the Widget Bundle. " + WIDGET_BUNDLE_DESCRIPTION + " " + |
82 | - "When creating the bundle, platform generates Widget Bundle Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address). " + | |
83 | + "When creating the bundle, platform generates Widget Bundle Id as " + UUID_WIKI_LINK + | |
83 | 84 | "The newly created Widget Bundle Id will be present in the response. " + |
84 | 85 | "Specify existing Widget Bundle id to update the Widget Bundle. " + |
85 | 86 | "Referencing non-existing Widget Bundle Id will cause 'Not Found' error." + | ... | ... |