latestOpenAPI 3.1.0Apache License Version 2.02026-08-17498525913.3 KB

40169ccdec5c

asset-controller

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.

post/api/asset

Query parameters

nameConflictPolicy'FAIL' | 'UNIQUIFY'

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.

uniquifySeparatorstring

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'.

uniquifyStrategy'RANDOM' | 'INCREMENTAL'

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.

Request body

createdTimeinteger

Timestamp of the asset creation, in milliseconds

namestring required

Unique Asset Name in scope of Tenant

typestring

Asset type

labelstring

Label that may be used in widgets

versioninteger
{"stackTrail":"components:schemas:JsonNode","oasType":"schema","type":"unknown","description":"A value representing the any type (object or primitive)","example":{}}

Example request

{
  "id": {
    "id": "784f394c-42b6-435a-983c-b7beff2784f9",
    "entityType": "ASSET"
  },
  "createdTime": 1609459200000,
  "tenantId": {
    "id": "784f394c-42b6-435a-983c-b7beff2784f9",
    "entityType": "TENANT"
  },
  "customerId": {
    "id": "784f394c-42b6-435a-983c-b7beff2784f9",
    "entityType": "CUSTOMER"
  },
  "name": "Empire State Building",
  "type": "Building",
  "label": "NY Building",
  "assetProfileId": {
    "id": "784f394c-42b6-435a-983c-b7beff2784f9",
    "entityType": "ASSET_PROFILE"
  },
  "additionalInfo": {}
}

Response

OK

createdTimeinteger

Timestamp of the asset creation, in milliseconds

namestring required

Unique Asset Name in scope of Tenant

typestring

Asset type

labelstring

Label that may be used in widgets

versioninteger
{"stackTrail":"components:schemas:JsonNode","oasType":"schema","type":"unknown","description":"A value representing the any type (object or primitive)","example":{}}

Example response

{
  "id": {
    "id": "784f394c-42b6-435a-983c-b7beff2784f9",
    "entityType": "ASSET"
  },
  "createdTime": 1609459200000,
  "tenantId": {
    "id": "784f394c-42b6-435a-983c-b7beff2784f9",
    "entityType": "TENANT"
  },
  "customerId": {
    "id": "784f394c-42b6-435a-983c-b7beff2784f9",
    "entityType": "CUSTOMER"
  },
  "name": "Empire State Building",
  "type": "Building",
  "label": "NY Building",
  "assetProfileId": {
    "id": "784f394c-42b6-435a-983c-b7beff2784f9",
    "entityType": "ASSET_PROFILE"
  },
  "additionalInfo": {}
}