Remove warnings (work package 1)
[anna.git] / INSTALL_ADML_HTTP.md
1 # ADML with REST Interface (ADML-HTTP)
2
3 ## Deployment
4
5 Execute this [script](./example/diameter/launcher/deploy-adml-http.sh [Variant: Release by default]) and follow instructions.
6
7 ## Building docker image
8
9 In our image, we enable the `HTTP2 Service` to attack the `HTTP1.1 ADML interface`. This is done through nginx proxy configured as reverse proxy to translate `HTTP2` traffic coming to port *8074* towards *localhost* port *8000* where `ADML HTTP` is going to serve the *HTTP1.1* Rest Service.
10
11 To build the docker image, execute this script:
12
13 > tools/build-anna-adml-http [variant: [Release]|Debug]
14
15 ## Running docker image
16
17 > docker run --rm -d -p 8074:8074 --name anna-adml-http anna-adml-http:<version> [entrypoint arguments: <[ft]|st>]
18
19 Entrypoint arguments are passed to ADML start script (`/opt/adml/start.sh` inside the container), and are mainly preconfigured variants for `ADML` command-line arguments. So, `ft` stands for `function test` (debug traces, traffic logs in real time, etc.) and `st` is `system test` (warning level for traces, no traffic logs dumped, etc.).
20
21 Service port is **8074**.
22
23 ## Basic operations
24
25 ### Monitoring ADML traces
26
27 > docker exec -it anna-adml-http tail -F /opt/adml/launcher.trace
28
29 ### Checking available diameter dictionaries
30
31 > docker exec -it anna-adml-http ls -1 /opt/adml/stacks
32 >
33 > DictionaryGx.16777238.xml
34 > DictionaryRx.16777236.xml
35 > DictionarySy.16777302.xml
36 > diameter_base.0.xml
37
38 ### Configure diameter nodes
39
40 You may use the *REST API* to load diameter services into *ADML*. This is the way to load stacks and nodes (origin hosts) in order to be up and running.
41
42 For example, consider an Origin-Host acting as diameter client with the name: **afHost.afRealm.com** and also a node named **ownHostId.operatorRealm.com** acting as diameter server, both using the *Rx interface* ( **/stacks/DictionaryRx.16777236.xml)**. You could configure any number of stacks/nodes to setup different diameter interfaces even having proxy/relay/translation capabilities.
43
44 You could load any number of services given by this [file specification](./example/diameter/launcher/resources/services_examples/services.dtd). Also, you could configure a single file and load together all the needed elements, for example:
45
46 `<services>`
47   `<stack id="16777236" dictionary="stacks/DictionaryRx.16777236.xml" fixMode="Always" ignoreFlagsOnValidation="yes"/>`
48   `<node originHost="afHost.afRealm.com" applicationId="16777236" entity="localhost:3868"/>`
49   `<node originHost="ownHostId.operatorRealm.com" applicationId="16777236" diameterServer="localhost:3868" diameterServerSessions="1"/>`
50 `</services>`
51
52 The REST API works with json format, then we shall use the [xml2json.py](./example/diameter/launcher/resources/rest_api/helpers/diameterJsonHelper/xml2json.py) tool to convert the previous one and insert on a node called "**servicesJson**":
53
54 > {
55 >    **"servicesJson": {**
56 >       "services": {
57 >          "node": [
58 >             {
59 >                "@applicationId": "16777236",
60 >                "@entity": "localhost:3868",
61 >                "@originHost": "afHost.afRealm.com"
62 >             },
63 >             {
64 >                "@applicationId": "16777236",
65 >                "@diameterServer": "localhost:3868",
66 >                "@diameterServerSessions": "1",
67 >                "@originHost": "ownHostId.operatorRealm.com"
68 >             }
69 >          ],
70 >          "stack": {
71 >             "@dictionary": "stacks/DictionaryRx.16777236.xml",
72 >             "@fixMode": "Always",
73 >             "@id": "16777236",
74 >             "@ignoreFlagsOnValidation": "yes"
75 >          }
76 >       }
77 >    **}**
78 > }
79
80 Then, you could load the former *services.json* file:
81
82 > nghttp -v -H ":method: POST" -d services.json http://localhost:8074/services
83
84
85
86 ## Component Test
87
88 Read [this](./example/diameter/launcher/resources/rest_api/README.md).
89