ThingsboardClient methods:
Asset assignAssetToCustomer(@Nonnull String customerId, @Nonnull String assetId) // Assign asset to customer (assignAssetToCustomer)
Asset assignAssetToEdge(@Nonnull String edgeId, @Nonnull String assetId) // Assign asset to edge (assignAssetToEdge)
Asset assignAssetToPublicCustomer(@Nonnull String assetId) // Make asset publicly available (assignAssetToPublicCustomer)
void deleteAsset(@Nonnull String assetId) // Delete asset (deleteAsset)
List<Asset> findAssetsByQuery(@Nonnull AssetSearchQuery assetSearchQuery) // Find related assets (findAssetsByQuery)
Asset getAssetById(@Nonnull String assetId) // Get Asset (getAssetById)
AssetInfo getAssetInfoById(@Nonnull String assetId) // Get Asset Info (getAssetInfoById)
List<EntitySubtype> getAssetTypes() // Get Asset Types (getAssetTypes)
List<Asset> getAssetsByIds(@Nonnull List<String> assetIds) // Get Assets By Ids (getAssetsByIds)
PageDataAssetInfo getCustomerAssetInfos(@Nonnull String customerId, @Nonnull Integer pageSize, @Nonnull Integer page, @Nullable String type, @Nullable String assetProfileId, @Nullable String textSearch, @Nullable String sortProperty, @Nullable String sortOrder) // Get Customer Asset Infos (getCustomerAssetInfos)
PageDataAsset getCustomerAssets(@Nonnull String customerId, @Nonnull Integer pageSize, @Nonnull Integer page, @Nullable String type, @Nullable String textSearch, @Nullable String sortProperty, @Nullable String sortOrder) // Get Customer Assets (getCustomerAssets)
PageDataAsset getEdgeAssets(@Nonnull String edgeId, @Nonnull Integer pageSize, @Nonnull Integer page, @Nullable String type, @Nullable String textSearch, @Nullable String sortProperty, @Nullable String sortOrder, @Nullable Long startTime, @Nullable Long endTime) // Get assets assigned to edge (getEdgeAssets)
Asset getTenantAssetByName(@Nonnull String assetName) // Get Tenant Asset (getTenantAssetByName)
PageDataAssetInfo getTenantAssetInfos(@Nonnull Integer pageSize, @Nonnull Integer page, @Nullable String type, @Nullable String assetProfileId, @Nullable String textSearch, @Nullable String sortProperty, @Nullable String sortOrder) // Get Tenant Asset Infos (getTenantAssetInfos)
PageDataAsset getTenantAssets(@Nonnull Integer pageSize, @Nonnull Integer page, @Nullable String type, @Nullable String textSearch, @Nullable String sortProperty, @Nullable String sortOrder) // Get Tenant Assets (getTenantAssets)
BulkImportResultAsset processAssetBulkImport(@Nonnull BulkImportRequest bulkImportRequest) // Import the bulk of assets (processAssetBulkImport)
Asset saveAsset(@Nonnull Asset asset, @Nullable NameConflictPolicy nameConflictPolicy, @Nullable String uniquifySeparator, @Nullable UniquifyStrategy uniquifyStrategy) // Create Or Update Asset (saveAsset)
Asset unassignAssetFromCustomer(@Nonnull String assetId) // Unassign asset from customer (unassignAssetFromCustomer)
Asset unassignAssetFromEdge(@Nonnull String edgeId, @Nonnull String assetId) // Unassign asset from edge (unassignAssetFromEdge)
Asset assignAssetToCustomer(@Nonnull String customerId, @Nonnull String assetId)
POST /api/customer/{customerId}/asset/{assetId}
Assign asset to customer (assignAssetToCustomer)
Creates assignment of the asset to customer. Customer will be able to query asset afterwards. Available for users with 'TENANT_ADMIN' authority.
| Name | Type | Description | Notes |
|---|---|---|---|
| customerId | String | A string value representing the customer id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' | |
| assetId | String | A string value representing the asset id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' |
Asset
Asset assignAssetToEdge(@Nonnull String edgeId, @Nonnull String assetId)
POST /api/edge/{edgeId}/asset/{assetId}
Assign asset to edge (assignAssetToEdge)
Creates assignment of an existing asset to an instance of The Edge. Assignment works in async way - first, notification event pushed to edge service queue on platform. Second, remote edge service will receive a copy of assignment asset (Edge will receive this instantly, if it's currently connected, or once it's going to be connected to platform). Third, once asset will be delivered to edge service, it's going to be available for usage on remote edge instance.
| Name | Type | Description | Notes |
|---|---|---|---|
| edgeId | String | A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' | |
| assetId | String | A string value representing the asset id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' |
Asset
Asset assignAssetToPublicCustomer(@Nonnull String assetId)
POST /api/customer/public/asset/{assetId}
Make asset publicly available (assignAssetToPublicCustomer)
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. Available for users with 'TENANT_ADMIN' authority.
| Name | Type | Description | Notes |
|---|---|---|---|
| assetId | String | A string value representing the asset id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' |
Asset
void deleteAsset(@Nonnull String assetId)
DELETE /api/asset/{assetId}
Delete asset (deleteAsset)
Deletes the asset and all the relations (from and to the asset). Referencing non-existing asset Id will cause an error. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.
| Name | Type | Description | Notes |
|---|---|---|---|
| assetId | String | A string value representing the asset id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' |
null (empty response body)
List<Asset> findAssetsByQuery(@Nonnull AssetSearchQuery assetSearchQuery)
POST /api/assets
Find related assets (findAssetsByQuery)
Returns all assets that are related to the specific entity. The entity id, relation type, asset types, depth of the search, and other query parameters defined using complex 'AssetSearchQuery' object. See 'Model' tab of the Parameters for more info.
| Name | Type | Description | Notes |
|---|---|---|---|
| assetSearchQuery | AssetSearchQuery |
List
Asset getAssetById(@Nonnull String assetId)
GET /api/asset/{assetId}
Get Asset (getAssetById)
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. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.
| Name | Type | Description | Notes |
|---|---|---|---|
| assetId | String | A string value representing the asset id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' |
Asset
AssetInfo getAssetInfoById(@Nonnull String assetId)
GET /api/asset/info/{assetId}
Get Asset Info (getAssetInfoById)
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 is an extension of the default Asset object that contains information about the assigned customer name. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.
| Name | Type | Description | Notes |
|---|---|---|---|
| assetId | String | A string value representing the asset id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' |
AssetInfo
List<EntitySubtype> getAssetTypes()
GET /api/asset/types
Get Asset Types (getAssetTypes)
Deprecated. See 'getAssetProfileNames' API from Asset Profile Controller instead. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.
List
List<Asset> getAssetsByIds(@Nonnull List<String> assetIds)
GET /api/assets
Get Assets By Ids (getAssetsByIds)
Requested assets must be owned by tenant or assigned to customer which user is performing the request.
| Name | Type | Description | Notes |
|---|---|---|---|
| assetIds | List | A list of assets ids, separated by comma ',' |
List
PageDataAssetInfo getCustomerAssetInfos(@Nonnull String customerId, @Nonnull Integer pageSize, @Nonnull Integer page, @Nullable String type, @Nullable String assetProfileId, @Nullable String textSearch, @Nullable String sortProperty, @Nullable String sortOrder)
GET /api/customer/{customerId}/assetInfos
Get Customer Asset Infos (getCustomerAssetInfos)
Returns a page of assets info objects assigned to customer. 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 response schema for more details. Asset Info is an extension of the default Asset object that contains information about the assigned customer name.
| Name | Type | Description | Notes |
|---|---|---|---|
| customerId | String | A string value representing the customer id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' | |
| pageSize | Integer | Maximum amount of entities in a one page | |
| page | Integer | Sequence number of page starting from 0 | |
| type | String | Asset type | [optional] |
| assetProfileId | String | A string value representing the asset profile id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' | [optional] |
| textSearch | String | The case insensitive 'substring' filter based on the asset name. | [optional] |
| sortProperty | String | Property of entity to sort by | [optional] [enum: createdTime, name, type, label, customerTitle] |
| sortOrder | String | Sort order. ASC (ASCENDING) or DESC (DESCENDING) | [optional] [enum: ASC, DESC] |
PageDataAssetInfo
PageDataAsset getCustomerAssets(@Nonnull String customerId, @Nonnull Integer pageSize, @Nonnull Integer page, @Nullable String type, @Nullable String textSearch, @Nullable String sortProperty, @Nullable String sortOrder)
GET /api/customer/{customerId}/assets
Get Customer Assets (getCustomerAssets)
Returns a page of assets objects assigned to customer. 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 response schema for more details.
| Name | Type | Description | Notes |
|---|---|---|---|
| customerId | String | A string value representing the customer id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' | |
| pageSize | Integer | Maximum amount of entities in a one page | |
| page | Integer | Sequence number of page starting from 0 | |
| type | String | Asset type | [optional] |
| textSearch | String | The case insensitive 'substring' filter based on the asset name. | [optional] |
| sortProperty | String | Property of entity to sort by | [optional] [enum: createdTime, name, type, label, customerTitle] |
| sortOrder | String | Sort order. ASC (ASCENDING) or DESC (DESCENDING) | [optional] [enum: ASC, DESC] |
PageDataAsset
PageDataAsset getEdgeAssets(@Nonnull String edgeId, @Nonnull Integer pageSize, @Nonnull Integer page, @Nullable String type, @Nullable String textSearch, @Nullable String sortProperty, @Nullable String sortOrder, @Nullable Long startTime, @Nullable Long endTime)
GET /api/edge/{edgeId}/assets
Get assets assigned to edge (getEdgeAssets)
Returns a page of assets assigned to edge. 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 response schema for more details.
| Name | Type | Description | Notes |
|---|---|---|---|
| edgeId | String | A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' | |
| pageSize | Integer | Maximum amount of entities in a one page | |
| page | Integer | Sequence number of page starting from 0 | |
| type | String | Asset type | [optional] |
| textSearch | String | The case insensitive 'substring' filter based on the asset name. | [optional] |
| sortProperty | String | Property of entity to sort by | [optional] [enum: createdTime, name, type, label, customerTitle] |
| sortOrder | String | Sort order. ASC (ASCENDING) or DESC (DESCENDING) | [optional] [enum: ASC, DESC] |
| startTime | Long | Timestamp. Assets with creation time before it won't be queried | [optional] |
| endTime | Long | Timestamp. Assets with creation time after it won't be queried | [optional] |
PageDataAsset
Asset getTenantAssetByName(@Nonnull String assetName)
GET /api/tenant/asset
Get Tenant Asset (getTenantAssetByName)
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. Available for users with 'TENANT_ADMIN' authority.
| Name | Type | Description | Notes |
|---|---|---|---|
| assetName | String | A string value representing the Asset name. |
Asset
PageDataAssetInfo getTenantAssetInfos(@Nonnull Integer pageSize, @Nonnull Integer page, @Nullable String type, @Nullable String assetProfileId, @Nullable String textSearch, @Nullable String sortProperty, @Nullable String sortOrder)
GET /api/tenant/assetInfos
Get Tenant Asset Infos (getTenantAssetInfos)
Returns a page of assets info objects owned by tenant. 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 response schema for more details. Asset Info is an extension of the default Asset object that contains information about the assigned customer name. Available for users with 'TENANT_ADMIN' authority.
| Name | Type | Description | Notes |
|---|---|---|---|
| pageSize | Integer | Maximum amount of entities in a one page | |
| page | Integer | Sequence number of page starting from 0 | |
| type | String | Asset type | [optional] |
| assetProfileId | String | A string value representing the asset profile id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' | [optional] |
| textSearch | String | The case insensitive 'substring' filter based on the asset name. | [optional] |
| sortProperty | String | Property of entity to sort by | [optional] [enum: createdTime, name, type, label, customerTitle] |
| sortOrder | String | Sort order. ASC (ASCENDING) or DESC (DESCENDING) | [optional] [enum: ASC, DESC] |
PageDataAssetInfo
PageDataAsset getTenantAssets(@Nonnull Integer pageSize, @Nonnull Integer page, @Nullable String type, @Nullable String textSearch, @Nullable String sortProperty, @Nullable String sortOrder)
GET /api/tenant/assets
Get Tenant Assets (getTenantAssets)
Returns a page of assets owned by tenant. 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 response schema for more details. Available for users with 'TENANT_ADMIN' authority.
| Name | Type | Description | Notes |
|---|---|---|---|
| pageSize | Integer | Maximum amount of entities in a one page | |
| page | Integer | Sequence number of page starting from 0 | |
| type | String | Asset type | [optional] |
| textSearch | String | The case insensitive 'substring' filter based on the asset name. | [optional] |
| sortProperty | String | Property of entity to sort by | [optional] [enum: createdTime, name, type, label, customerTitle] |
| sortOrder | String | Sort order. ASC (ASCENDING) or DESC (DESCENDING) | [optional] [enum: ASC, DESC] |
PageDataAsset
BulkImportResultAsset processAssetBulkImport(@Nonnull BulkImportRequest bulkImportRequest)
POST /api/asset/bulk_import
Import the bulk of assets (processAssetBulkImport)
There's an ability to import the bulk of assets using the only .csv file.
| Name | Type | Description | Notes |
|---|---|---|---|
| bulkImportRequest | BulkImportRequest |
BulkImportResultAsset
Asset saveAsset(@Nonnull Asset asset, @Nullable NameConflictPolicy nameConflictPolicy, @Nullable String uniquifySeparator, @Nullable UniquifyStrategy uniquifyStrategy)
POST /api/asset
Create Or Update Asset (saveAsset)
Creates or Updates the Asset. When creating asset, platform generates Asset Id as time-based UUID. 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. Remove 'id', 'tenantId' and optionally 'customerId' from the request body example (below) to create new Asset entity. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.
| Name | Type | Description | Notes |
|---|---|---|---|
| asset | Asset | A JSON value representing the asset. | |
| nameConflictPolicy | NameConflictPolicy | Optional value of name conflict policy. Possible values: FAIL or UNIQUIFY. If omitted, FAIL policy is applied. FAIL policy implies exception will be thrown if an entity with the same name already exists. UNIQUIFY policy appends a suffix to the entity name, if a name conflict occurs. | [optional] [default to FAIL] [enum: FAIL, UNIQUIFY] |
| uniquifySeparator | String | Optional value of name suffix separator used by UNIQUIFY policy. By default, underscore separator is used. For example, strategy is UNIQUIFY, separator is '-'; if a name conflict occurs for entity name 'test-name', created entity will have name like 'test-name-7fsh4f'. | [optional] [default to _] |
| uniquifyStrategy | UniquifyStrategy | Optional value of uniquify strategy used by UNIQUIFY policy. Possible values: RANDOM or INCREMENTAL. By default, RANDOM strategy is used, which means random alphanumeric string will be added as a suffix to entity name. INCREMENTAL implies the first possible number starting from 1 will be added as a name suffix. For example, strategy is UNIQUIFY, uniquify strategy is INCREMENTAL; if a name conflict occurs for entity name 'test-name', created entity will have name like 'test-name-1. | [optional] [default to RANDOM] [enum: RANDOM, INCREMENTAL] |
Asset
Asset unassignAssetFromCustomer(@Nonnull String assetId)
DELETE /api/customer/asset/{assetId}
Unassign asset from customer (unassignAssetFromCustomer)
Clears assignment of the asset to customer. Customer will not be able to query asset afterwards. Available for users with 'TENANT_ADMIN' authority.
| Name | Type | Description | Notes |
|---|---|---|---|
| assetId | String | A string value representing the asset id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' |
Asset
Asset unassignAssetFromEdge(@Nonnull String edgeId, @Nonnull String assetId)
DELETE /api/edge/{edgeId}/asset/{assetId}
Unassign asset from edge (unassignAssetFromEdge)
Clears assignment of the asset to the edge. Unassignment works in async way - first, 'unassign' notification event pushed to edge queue on platform. Second, remote edge service will receive an 'unassign' command to remove asset (Edge will receive this instantly, if it's currently connected, or once it's going to be connected to platform). Third, once 'unassign' command will be delivered to edge service, it's going to remove asset locally.
| Name | Type | Description | Notes |
|---|---|---|---|
| edgeId | String | A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' | |
| assetId | String | A string value representing the asset id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' |
Asset