latestOpenAPI 3.1.0Apache License Version 2.02026-08-17498525913.3 KB

40169ccdec5c

entities-version-control-controller

Load entities version (loadEntitiesVersion)

Loads specific version of remote entities (or single entity) by request. Supported entity types: CUSTOMER, ASSET, RULE_CHAIN, DASHBOARD, DEVICE_PROFILE, DEVICE, ENTITY_VIEW, WIDGETS_BUNDLE.

There are multiple types of request. Each of them requires branch name (branch) and version id (versionId). Request of type SINGLE_ENTITY is needed to restore a concrete version of a specific entity. It contains id of a remote entity (externalEntityId) and additional configuration (config):

  • loadRelations - to update relations list (in case saveRelations option was enabled during version creation);
  • loadAttributes - to load entity attributes (if saveAttributes config option was enabled);
  • loadCredentials - to update device credentials (if saveCredentials option was enabled during version creation).

An example of such request:

{
  "type": "SINGLE_ENTITY",
  
  "branch": "dev",
  "versionId": "b3c28d722d328324c7c15b0b30047b0c40011cf7",
  
  "externalEntityId": {
    "entityType": "DEVICE",
    "id": "b7944123-d4f4-11ec-847b-0f432358ab48"
  },
  "config": {
    "loadRelations": false,
    "loadAttributes": true,
    "loadCredentials": true
  }
}

Another request type (ENTITY_TYPE) is needed to load specific version of the whole entity types. It contains a structure with entity types to load and configs for each entity type (entityTypes). For each specified entity type, the method will load all remote entities of this type that are present at the version. A config for each entity type contains the same options as in SINGLE_ENTITY request type, and additionally contains following options:

  • removeOtherEntities - to remove local entities that are not present on the remote - basically to overwrite local entity type with the remote one;
  • findExistingEntityByName - when you are loading some remote entities that are not yet present at this tenant, try to find existing entity by name and update it rather than create new.

Here is an example of the request to completely restore version of the whole device entity type:

{
  "type": "ENTITY_TYPE",

  "branch": "dev",
  "versionId": "b3c28d722d328324c7c15b0b30047b0c40011cf7",

  "entityTypes": {
    "DEVICE": {
      "removeOtherEntities": true,
      "findExistingEntityByName": false,
      "loadRelations": true,
      "loadAttributes": true,
      "loadCredentials": true
    }
  }
}

The response will contain generated request UUID that is to be used to check the status of operation via getVersionLoadRequestStatus.

Available for users with 'TENANT_ADMIN' authority.

post/api/entities/vc/entity

Request body

OR

Example request

{
  "externalEntityId": {
    "id": "784f394c-42b6-435a-983c-b7beff2784f9",
    "entityType": "DEVICE"
  }
}

Response

OK

string uuid required