latestOpenAPI 3.1.0Apache License Version 2.02026-08-17498525913.3 KB

40169ccdec5c

entities-version-control-controller

Save entities version (saveEntitiesVersion)

Creates a new version of entities (or a single entity) by request. Supported entity types: CUSTOMER, ASSET, RULE_CHAIN, DASHBOARD, DEVICE_PROFILE, DEVICE, ENTITY_VIEW, WIDGETS_BUNDLE.

There are two available types of request: SINGLE_ENTITY and COMPLEX. Each of them contains version name (versionName) and name of a branch (branch) to create version (commit) in. If specified branch does not exists in a remote repo, then new empty branch will be created. Request of the SINGLE_ENTITY type has id of an entity (entityId) and additional configuration (config) which has following options:

  • saveRelations - whether to add inbound and outbound relations of type COMMON to created entity version;
  • saveAttributes - to save attributes of server scope (and also shared scope for devices);
  • saveCredentials - when saving a version of a device, to add its credentials to the version.

An example of a SINGLE_ENTITY version create request:

{
  "type": "SINGLE_ENTITY",

  "versionName": "Version 1.0",
  "branch": "dev",

  "entityId": {
    "entityType": "DEVICE",
    "id": "b79448e0-d4f4-11ec-847b-0f432358ab48"
  },
  "config": {
    "saveRelations": true,
    "saveAttributes": true,
    "saveCredentials": false
  }
}

Second request type (COMPLEX), additionally to branch and versionName, contains following properties:

  • entityTypes - a structure with entity types to export and configuration for each entity type; this configuration has all the options available for SINGLE_ENTITY and additionally has these ones:
    • allEntities and entityIds - if you want to save the version of all entities of the entity type then set allEntities param to true, otherwise set it to false and specify the list of specific entities (entityIds);
    • syncStrategy - synchronization strategy to use for this entity type: when set to OVERWRITE then the list of remote entities of this type will be overwritten by newly added entities. If set to MERGE - existing remote entities of this entity type will not be removed, new entities will just be added on top (or existing remote entities will be updated).
  • syncStrategy - default synchronization strategy to use when it is not specified for an entity type.

Example for this type of request:

{
  "type": "COMPLEX",

  "versionName": "Devices and profiles: release 2",
  "branch": "master",

  "syncStrategy": "OVERWRITE",
  "entityTypes": {
    "DEVICE": {
      "syncStrategy": null,
      "allEntities": true,
      "saveRelations": true,
      "saveAttributes": true,
      "saveCredentials": true
    },
    "DEVICE_PROFILE": {
      "syncStrategy": "MERGE",
      "allEntities": false,
      "entityIds": [
        "b79448e0-d4f4-11ec-847b-0f432358ab48"
      ],
      "saveRelations": true
    }
  }
}

Response wil contain generated request UUID, that can be then used to retrieve status of operation via getVersionCreateRequestStatus.

Available for users with 'TENANT_ADMIN' authority.

post/api/entities/vc/version

Request body

OR

Example request

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

Response

OK

string uuid required