Rift.IO OSM R1 Initial Submission
[osm/UI.git] / skyquake / plugins / composer / src / schemas / yang / README.md
1 The backend system is managed by CONFD YANG files. These files contain details about what inputs the backend systems accept.
2
3 We generate a domain specific language (DSL) in JSON to drive rendering a "model driven" editor in the composer.
4
5
6 One Step:
7
8 Accomplish the below steps in one script `./generate-model-meta-json.sh`.
9
10 If you need to run the steps manually for debugging, etc. Then do the following.
11
12
13 Multi Step:
14
15 To generate this DSL, we take the following steps:
16
17 1. Collect the latest .yang files from the backend code bases and put them into this directory.
18
19 2. Run `yang2json.sh`
20
21 Requires yangforge to be installed `npm install -g yangforge`
22
23 This is brittle and requires removing any dependencies that fail. Usually, mano-types.yang has typedef references that do not have the 'manotype' prefix.
24 For example, 'type param-type-value' should be 'type manotypes:param-type-value'.
25
26 3. Run `node confd2model.js`
27
28 Review output to make sure it looks good.
29
30 4. Run `node confd2model.js > ./model-meta.json`
31
32 5. Copy the contents of ./model-meta.json into /webapp/src/libraries/DescriptorModelMeta.json
33
34 Verify the composer details editor is working properly.
35
36 Note:
37
38 The build servers do not like our .yang files so we append .src to the file names.
39
40 The yang2json.sh script does this for you now so you don' have to do the following. However, make sure you do not commit
41 .yang files because it will break the build.
42
43 Before committing these yang files, run `./src-append.sh` to append .src to the .yang files.
44
45 Before running the above steps remove the .src with `./src-remove.sh`.