latestOpenAPI 3.1.0Apache License Version 2.02026-08-17498525913.3 KB

40169ccdec5c

entity-relation-controller

Create Relation (saveRelation)

Creates or updates a relation between two entities in the platform. Relations unique key is a combination of from/to entity id and relation type group and relation type.

If the user has the authority of 'System Administrator', the server checks that 'from' and 'to' entities are owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that 'from' and 'to' entities are owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the 'from' and 'to' entities are assigned to the same customer.

post/api/relation

Request body

typestring required

String value of relation type.

typeGroup'COMMON' | 'DASHBOARD' | 'RULE_CHAIN' | 'RULE_NODE' | 'EDGE' | 'EDGE_AUTO_ASSIGN_RULE_CHAIN' required

Represents the type group of the relation.

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

Example request

{
  "from": {
    "id": "784f394c-42b6-435a-983c-b7beff2784f9",
    "entityType": "DEVICE"
  },
  "to": {
    "id": "784f394c-42b6-435a-983c-b7beff2784f9",
    "entityType": "DEVICE"
  },
  "type": "Contains",
  "typeGroup": "COMMON",
  "additionalInfo": {}
}

Response

OK