In this release

This version includes significant delete operations improvements and a couple of PATCH operation improvements.

New functionality

Hard delete

Simple delete means that the twin is archived in the database. Hard delete means complete database removal of the twin without leaving any fallback copy (except snapshot history).

Hard delete is not allowed for twins with orphans. Meaning that orphans need to be deleted first. Hard delete can be called with the new query parameter ‘hard’ using the existing DELETE endpoints.

DELETE https://<host>/api/json/<class>/<uuid>?hard=true

Multiple delete

Now it is possible to delete a batch of items in one call. The new batch delete endpoints are implemented as http POST method that accepts body of the following format:

{
“hard”: “boolean,
“twinIds”: [
“<uuid1>”,
“<uuid2>”
]
}

The list of new endpoints (note the plural “s”):

  • POST /json/realestates/delete
  • POST /json/realestatecomponents/delete
  • POST /json/buildingcomponents/delete
  • POST /json/rooms/delete
  • POST /json/storeys/delete
  • POST /json/assets/delete
  • POST /json/devices/delete
  • POST /json/sensors/delete
  • POST /json/actuators/delete
  • POST /json/aliasnamespaces/delete

PATCH improvements

Patching Alias

Twin property ‘hasAlias’ can be patched with two operations ADD and REMOVE with the correct Alias json object. Partial Alias patching is not supported. Example:

PATCH https://<host>/api/json/<class>/<uuid>

[
  {
    “op”: “add“,
    “path”: “/hasAlias“,
    “value”: {
      “id”: “string“,
      “isMemberOfAliasNamespace”: “3fa85f64-5717-4562-b3fc-2c963f66afa6
    }
  },
  {
    “op”: “remove“,
    “path”: “/hasAlias“,
    “value”: {
      “id”: “string“,
      “isMemberOfAliasNamespace”: “3fa85f64-5717-4562-b3fc-2c963f66afa6
  }
]

Patching Twin status

Twin property ‘status’ can be patched with operation REPLACE.

PATCH https://<host>/api/json/<class>/<uuid>

[
{
“op”: “replace“,
“path”: “/status“,
“value”: “Valid/Incomplete/Incorrect/SuspectedInvalid/Test
}
]

(Note: Archive value is used only for archived twins)

Patching Source and Comment properties

Twin properties source and comment’ can be patched with operations ADD,REPLACE,REMOVE.

PATCH https://<host>/api/json/<class>/<uuid>

[
  {
    “op”: “add”,
    “path”: “/source/newProperty”,
    “value”: “string”
  },
{
    “op”: “replace”,
    “path”: “/status/existingProperty”,
    “value”: “string”
  },
{
    “op”: “remove”,
    “path”: “/status/existingProperty”,
    “value”: “string”
  }
]

[
  {
    “op”: “add”,
    “path”: “/comment/newProperty”,
    “value”: “string”
  },
{
    “op”: “replace”,
    “path”: “/comment/existingProperty”,
    “value”: “string”
  },
{
    “op”: “remove”,
    “path”: “/comment/existingProperty”,
    “value”: “string”
  } 
]

Breaking changes

None

Fixes and minor updated

Open API documentation fixes and improvements.