Dynamic data model API overview (using class 'abc/mnesia' as an example)
- Overview
- Requests
- Creating a new entity in a dynamic class collection
- Getting the list of entities from a dynamic class collection
- Getting entity data from a dynamic class collection
- Replacing/placing an entity in a dynamic class collection
- Modifying entity data in a dynamic class collection
- Deleting an entity from a dynamic class collection
- Clears the dynamic class collection
- Searching for an entity identifier in a dynamic class collection
- Runtime configuration of a dynamic class collection
- Contents (child resources)
- Links
Overview
Allows CRUD operations on a dynamic class collection.
Operations are also available via the WebSocket API (capability `rest`).
Attachment file operations are supported.
When a path with a trailing slash is specified, the GET operation returns the list of available child-level sections/collections.
To perform operations on entities of a class with storage_mode: history, the path must include the value of the property configured in the class in opts.partition_property. For example the value from the "dateTime" property when making requests to an entity of the platform/log/HistoryChanges class.
Requests
| HTTP verb | Endpoint | Description |
|---|---|---|
|
|
|
|
|
Getting the list of entities from a dynamic class collection |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Getting entity data from a historical dynamic class collection |
|
|
Replacing/placing an entity in a historical dynamic class collection |
|
|
Modifying entity data in a historical dynamic class collection |
|
|
Deleting an entity from a historical dynamic class collection |
|
|
|
|
|
Searching for an entity identifier in a dynamic class collection |
|
|
Creating a new entity in a dynamic class collection
Request
Field description: determined based on class property settings (class entity)
POST /rest/v1/model/abc/mnesia HTTP/1.1
Content-Type: application/json; charset=utf-8
determined based on class property settings (class entity)
Response
Field description: determined based on class property settings (class entity)
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "6f7d27df-017b-ab81-77e7-7cd30a921f58",
"patts":[],
"pbool": false,
"penum": "i1",
"pint": 8640000,
"plong": 1630924984167,
"pstr": "asdfasdfasdf"
}
Getting the list of entities from a dynamic class collection
Request
| Name | Type | Description |
|---|---|---|
|
|
Element filter. It is a logical expression in Polish notation. Specified as a JSON array representing the Polish notation of a complex logical expression. The first element of any array is the function name (string); the second and subsequent list elements are function arguments, each of which can in turn be an expression (JSON array). Examples:
|
|
|
Resource sorting order in the list. Applies a sequence of fields, each with a defined sort direction; when values match, applies the next field. Examples:
|
|
|
List of fields to output. Available fields for output: (configured in the specific class options - the `max_mask` field). For dynamic collections, masking is performed only at the first depth level; composite values are included or excluded entirely. Example:
|
|
|
Offset in the list of resources to output.
Zero-based index in the filtered ( Example:
|
|
|
Maximum number of resources to output from the filtered ( Example:
|
|
|
Flag indicating whether to output only the number of elements matching the filter conditions. |
|
|
Streaming read operation identifier for optimizing paginated reading from collections of types runtime, ram, and ets. Without the 'snapshot' parameter, each read request for each page filters the entire table and sorts the result, from which the page is then cut. If the task is to load data into the cache by reading many pages, snapshot should be used. This can optimize the process. There are two different approaches. A) Paginated reading from a snapshot Applied if the 'snapshot' parameter is set and differs from The process looks as follows:
The mode is not applied to collections with fewer than 3000 records or to aggregating requests. B) Reading the snapshot entirely Applied if the 'snapshot' parameter equals Without the order parameter the request executes significantly more optimally in time and server memory usage. The limit and offset options are not prohibited and will apply if specified, but the cache loading process does not assume their use. The process looks as follows:
|
|
|
For collections of type 'history' and 'transactionlog', a required parameter specifying the time interval for data selection. To access the endpoint of a specific element of such collections, use the date as an intermediate path segment. |
|
|
Aggregated value descriptor. The key is an arbitrary field name, the value is an aggregating expression (where the main function is aggregating). Used together with the 'groupby' parameter. Example:
|
|
|
Descriptor of grouping fields or expressions. The key is an arbitrary field name, the value is the name of an actually existing class field or an expression similar to filter, but not necessarily logical. Used together with the 'aggr' parameter. Example:
|
| Function (and synonyms) | Number of arguments | Description |
|---|---|---|
|
|
Access to any entity field, including by a deep path in complex object and list fields. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Function (and synonyms) | Number of arguments | Description |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GET /rest/v1/model/abc/mnesia?offset=0&limit=2 HTTP/1.1
Response
Field description: determined based on class property settings (class entity)
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
[
{
"id": "6f7d27df-017b-ab81-77e7-7cd30a921f58",
"patt":{
"hasha": "md5;A95C530A7AF5F492A74499E70578D150",
"link": "fs://1a2325b6-017b-abab-bba4-7cd30a921f58/fstest_attaches/test.rootdomain.ru/abc/mnesia/6f7d27df-017b-ab81-77e7-7cd30a921f58/patt/content",
"mtime": "2021-09-07T10:47:06Z",
"name": "content",
"size": 12
},
"patts":[
{
"hasha": "md5;2B00042F7481C7B056C4B410D28F33CF",
"link": "fs://1a2325b6-017b-abab-bba4-7cd30a921f58/fstest_attaches/test.rootdomain.ru/abc/mnesia/6f7d27df-017b-ab81-77e7-7cd30a921f58/patts/app.mp3",
"mtime": "2021-09-07T10:47:47Z",
"name": "app.mp3",
"size": 538925
},
{
"hasha": "md5;236C8E5A21AF6E369045F004B1CAEA1C",
"link": "fs://1a2325b6-017b-abab-bba4-7cd30a921f58/fstest_attaches/test.rootdomain.ru/abc/mnesia/6f7d27df-017b-ab81-77e7-7cd30a921f58/patts/test.json",
"mtime": "2021-09-07T10:47:47Z",
"name": "test.json",
"size": 14
}
],
"pbool": false,
"penum": "i1",
"pint": 8640000,
"plong": 1630924984167,
"pstr": "asdfasdfasdf"
}
]
Getting entity data from a dynamic class collection
Request
| Name | Type | Description |
|---|---|---|
|
|
List of fields to output. |
|
|
Conversion of composite fields to flat form. |
GET /rest/v1/model/abc/mnesia/6f7d27df-017b-ab81-77e7-7cd30a921f58 HTTP/1.1
GET /rest/v1/model/abc/mnesia/2026-03-06T10:14:37.251Z/6f7d27df-017b-ab81-77e7-7cd30a921f58 HTTP/1.1
Response
Field description: determined based on class property settings (class entity)
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "6f7d27df-017b-ab81-77e7-7cd30a921f58",
"patt":{
"hasha": "md5;A95C530A7AF5F492A74499E70578D150",
"link": "fs://1a2325b6-017b-abab-bba4-7cd30a921f58/fstest_attaches/test.rootdomain.ru/abc/mnesia/6f7d27df-017b-ab81-77e7-7cd30a921f58/patt/content",
"mtime": "2021-09-07T10:47:06Z",
"name": "content",
"size": 12
},
"patts":[
{
"hasha": "md5;2B00042F7481C7B056C4B410D28F33CF",
"link": "fs://1a2325b6-017b-abab-bba4-7cd30a921f58/fstest_attaches/test.rootdomain.ru/abc/mnesia/6f7d27df-017b-ab81-77e7-7cd30a921f58/patts/app.mp3",
"mtime": "2021-09-07T10:47:47Z",
"name": "app.mp3",
"size": 538925
},
{
"hasha": "md5;236C8E5A21AF6E369045F004B1CAEA1C",
"link": "fs://1a2325b6-017b-abab-bba4-7cd30a921f58/fstest_attaches/test.rootdomain.ru/abc/mnesia/6f7d27df-017b-ab81-77e7-7cd30a921f58/patts/test.json",
"mtime": "2021-09-07T10:47:47Z",
"name": "test.json",
"size": 14
}
],
"pbool": false,
"penum": "i1",
"pint": 8640000,
"plong": 1630924984167,
"pstr": "asdfasdfasdf"
}
Replacing/placing an entity in a dynamic class collection
The operation performs either a complete entity replacement in the collection if an entity with the specified identifier already exists there, or initial placement with the specified identifier if no entity with such identifier is found in the collection. By default the operation performs a preliminary read to check security conditions set in the class. The preliminary read can be disabled by class settings.
-
Entities with storage type 'runtime' and a configured automatic deletion mode can extend their lifetime on replacement.
Request
Field description: determined based on class property settings (class entity)
PUT /rest/v1/model/abc/mnesia/6f7d27df-017b-ab81-77e7-7cd30a921f58 HTTP/1.1
Content-Type: application/json; charset=utf-8
determined based on class property settings (class entity)
PUT /rest/v1/model/abc/mnesia/2026-03-06T10:14:37.251Z/6f7d27df-017b-ab81-77e7-7cd30a921f58 HTTP/1.1
Content-Type: application/json; charset=utf-8
determined based on class property settings (class entity)
Response
Field description: determined based on class property settings (class entity)
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "6f7d27df-017b-ab81-77e7-7cd30a921f58",
"patt":{
"hasha": "md5;A95C530A7AF5F492A74499E70578D150",
"link": "fs://1a2325b6-017b-abab-bba4-7cd30a921f58/fstest_attaches/test.rootdomain.ru/abc/mnesia/6f7d27df-017b-ab81-77e7-7cd30a921f58/patt/content",
"mtime": "2021-09-07T10:47:06Z",
"name": "content",
"size": 12
},
"patts":[
{
"hasha": "md5;2B00042F7481C7B056C4B410D28F33CF",
"link": "fs://1a2325b6-017b-abab-bba4-7cd30a921f58/fstest_attaches/test.rootdomain.ru/abc/mnesia/6f7d27df-017b-ab81-77e7-7cd30a921f58/patts/app.mp3",
"mtime": "2021-09-07T10:47:47Z",
"name": "app.mp3",
"size": 538925
},
{
"hasha": "md5;236C8E5A21AF6E369045F004B1CAEA1C",
"link": "fs://1a2325b6-017b-abab-bba4-7cd30a921f58/fstest_attaches/test.rootdomain.ru/abc/mnesia/6f7d27df-017b-ab81-77e7-7cd30a921f58/patts/test.json",
"mtime": "2021-09-07T10:47:47Z",
"name": "test.json",
"size": 14
}
],
"pbool": true,
"penum": "i1",
"pint": 8640000,
"plong": 1630924980256,
"pstr": "Next value"
}
Modifying entity data in a dynamic class collection
The operation performs a preliminary read and then merges the current object with the passed value.
-
The value 'null' zeroes the field.
-
Values of fields with type 'any' are merged in depth instead of replaced, by the number of levels specified in the corresponding field options.
-
Values of all fields having the 'multi' option (arrays) can be appended to the end of current values if the 'append' parameter is passed in the request (append=true).
-
Entities with storage type 'runtime' and a configured automatic deletion mode can extend their lifetime on update.
Fields prohibited from modification: id
Request
Field description: determined based on class property settings (class entity)
PATCH /rest/v1/model/abc/mnesia/6f7d27df-017b-ab81-77e7-7cd30a921f58 HTTP/1.1
Content-Type: application/json; charset=utf-8
determined based on class property settings (class entity)
PATCH /rest/v1/model/abc/mnesia/2026-03-06T10:14:37.251Z/6f7d27df-017b-ab81-77e7-7cd30a921f58 HTTP/1.1
Content-Type: application/json; charset=utf-8
determined based on class property settings (class entity)
Response
Field description: determined based on class property settings (class entity)
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "6f7d27df-017b-ab81-77e7-7cd30a921f58",
"patt":{
"hasha": "md5;A95C530A7AF5F492A74499E70578D150",
"link": "fs://1a2325b6-017b-abab-bba4-7cd30a921f58/fstest_attaches/test.rootdomain.ru/abc/mnesia/6f7d27df-017b-ab81-77e7-7cd30a921f58/patt/content",
"mtime": "2021-09-07T10:47:06Z",
"name": "content",
"size": 12
},
"patts":[
{
"hasha": "md5;2B00042F7481C7B056C4B410D28F33CF",
"link": "fs://1a2325b6-017b-abab-bba4-7cd30a921f58/fstest_attaches/test.rootdomain.ru/abc/mnesia/6f7d27df-017b-ab81-77e7-7cd30a921f58/patts/app.mp3",
"mtime": "2021-09-07T10:47:47Z",
"name": "app.mp3",
"size": 538925
},
{
"hasha": "md5;236C8E5A21AF6E369045F004B1CAEA1C",
"link": "fs://1a2325b6-017b-abab-bba4-7cd30a921f58/fstest_attaches/test.rootdomain.ru/abc/mnesia/6f7d27df-017b-ab81-77e7-7cd30a921f58/patts/test.json",
"mtime": "2021-09-07T10:47:47Z",
"name": "test.json",
"size": 14
}
],
"pbool": true,
"penum": "i2",
"pint": 8640000,
"plong": 1630924984167,
"pstr": "Other value"
}
Deleting an entity from a dynamic class collection
Searching for an entity identifier in a dynamic class collection
Searches for a resource by the specified key and returns identifier(s) for building the endpoint.
Key fields for search: (identifier and fields configured in the specific class options - the `lookup_properties` field)
Runtime configuration of a dynamic class collection
Performs runtime configuration of the collection, changing its behavior.
{
"cmd": ...,
...
}
Command types ('cmd'):
-
suspend_notification- temporarily suspends sending notifications about class entity changes (effective until cancellation or microservice restart). This mode can be used for large-scale modification operations with hundreds or thousands of subscribers. -
resume_notification- resumes previously suspended notification sending. At the same time it may send (by default) or not send the 'reload' operation event to all current subscribers (additional optional 'send_reload' parameter). -
read_partitions- returns the partition list. Applies to types 'history' and 'transactionlog' with clickhouse storage. -
drop_partition- deletes the specified partition passed in the additional 'partition' parameter with a value taken from the 'read_partitions' request response. Applies to storage_mode 'history' and 'transactionlog' with clickhouse storage. -
optimize- performs table finalization/optimization. Applies to storage_mode 'transactionlog' with clickhouse storage. -
reencrypt_secrets- re-encrypts secret properties of class entities with the current installation key (more). Admin role only. On a DMS node one class is re-encrypted at a time; the rest wait in the queue. Returns state:statusrunningorqueuedwithposition(queue place, starting at 1). If the class is already being re-encrypted or is queued — error 409. A repeated command after completion starts re-encryption again. Not applicable to classes without secret properties, to storage_mode 'history', 'transactionlog', 'ets', 'ram', 'runtime', and without an installation key (422). -
reencrypt_secrets_state- returns class re-encryption state without starting it. Admin role only.status:none(not started),queued(withposition),running,done,failed,cancelled;kid(installation key),done(entities viewed),changed(re-encrypted),errors(not re-encrypted: value cannot be decrypted),started; after completion —finished, fordone—marked(class marked as re-encrypted: no errors). State is stored on the DMS node and is lost on its restart. -
reencrypt_secrets_cancel- cancels class re-encryption. Admin role only. A queued class is removed from the queue; an ongoing re-encryption stops after the current entity portion;statuscancelled, the class is not marked as re-encrypted. If the class is not queued and not being re-encrypted (or is already completing re-encryption) — error 409. -
reencrypt_secrets_mark- marks the class as re-encrypted with the current key without re-encryption (data is known to be current, for example the class was recreated with the same data). Admin role only.if_emptyparameter:true— only if the class has no entities. Responsemarked:true|false. Refusals are as forreencrypt_secrets; class queued or being re-encrypted — error 409.