Preconfigured entities (fixtures)
Overview
Define specific entities and their parameters for automatic creation in the domain (only entities managed by the domain center - roles mdc).
Applied to the domain at the time of its creation and possibly at the time the domain is reloaded by the role mdc.
The application is done secondarily: general fixtures are applied to the domain first and then solushen fixtures. In this case to the master domain, only the master domain’s fixtures are applied (the master domain’s solushen can also be specified, but it makes no sense). Any other domain applies the common fixtures of the worker domain and the fixtures of its solutio. The application goes in the sort order of the file names.
Each file can contain many objects to be created. Each directory may contain any number of fixture files, applied in the lexicographic sort order of the file names.
{ "objects": [ { "crud": str, "applycondition": "always" | "notexist", "data": object }, ... ] }
-
"crud"
– type of created object in a format known to the role mdc (domain, user, featurecode, sipuser, vectorrule, addressbook, …). -
"applycondition"
– conditions for creating entities when loading a domain:-
"always"
– recreate the object each time the domain is loaded; -
"notexist"
– create an object only if it does not exist in the domain.
-
-
"data"
– object to be created (fields and values)
Example
Creates a user, if there is no user, with a specific identity, role. Does not modify the user if it is manually modified, but recreates it if it is deleted.
{ "objects": [ { "crud": "user", "applycondition": "notexists", "data": { "id": "8de96fb8-afc2-67e1-057a-60115bc80006", "name": "sample_user", "pwd": "user123", "login": "sample_user" "opts": {"roles": ["sample"]} } } ] }
See also
-
Entities domain