Update documentation regarding HTTP / HTTPS
[externalapi/nbi.git] / docs / installation / installation.rst
1 .. SPDX-License-Identifier: CC-BY-4.0
2 .. Copyright 2018 ORANGE
3
4
5 Installation
6 ============
7
8 This document describes local installation for development purpose
9 It also describes some keypoints for understanding NBI in OOM context
10
11 Build
12 -----
13
14 Requirements
15
16 * Java 11
17 * Maven
18 * free port 8080, used by tests
19
20 Build::
21
22     mvn clean package
23
24 Alternative 1 run SpringBoot application
25 ----------------------------------------
26
27 Requirements
28
29 * Java 11
30 * Maven
31 * MongoDB
32 * MariaDB
33
34 Review and edit *src/main/resources/application.properties*
35
36 Defaults
37
38     Mongo, host=localhost, port=27017, database=ServiceOrderDB
39
40     Mariadb, url=jdbc:mariadb://localhost:3306/nbi, username=root,
41     password=secret
42
43 Run::
44
45     mvn spring-boot:run
46
47 Alternative 2 run docker
48 ------------------------
49
50 Requirements
51
52 * Docker
53 * Docker-compose
54 * Free ports 8080
55
56 Edit *docker-compose.yml* to select previous generated local build, replace::
57
58     image: ${NEXUS_DOCKER_REPO}/onap/externalapi/nbi:latest
59
60 by::
61
62     build: .
63
64 Run::
65
66     docker-compose up -d mongo mariadb
67
68     docker-compose up --build -d nbi
69
70 Logs::
71
72     docker-compose logs -f nbi
73
74
75 Local tests
76 -----------
77
78 Status is available at http://localhost:8080/nbi/api/v4/status
79
80 Running a standalone test::
81
82     curl "http://localhost:8080/nbi/api/v4/status"
83
84 You should get::
85
86     {
87         "name": "nbi",
88         "status": "ok",
89         "version": "v4"
90     }
91
92 Play with Postman
93 -----------------
94
95 A full collection of requests is available in *docs/offeredapis/postman* for inspiration
96
97 OOM Context
98 -----------
99
100 **Healthcheck**
101
102 Running a standalone test::
103
104     curl "https://nbi.api.simpledemo.onap.org:30274/nbi/api/v4/status"
105
106     {
107         "name": "nbi",
108         "status": "ok",
109         "version": "v4"
110     }
111
112 Running an integration test with SO, SDC, DMAAP, AAI::
113
114     curl "https://nbi.api.simpledemo.onap.org:30274/nbi/api/v4/status?fullStatus=true"
115
116     {
117         "name": "nbi",
118         "status": "ok",
119         "version": "v4",
120         "components": [
121             {
122                 "name": "so connectivity",
123                 "status": "ok"
124             },
125             {
126                 "name": "sdc connectivity",
127                 "status": "ok"
128             },
129             {
130                 "name": "dmaap connectivity",
131                 "status": "ok"
132             },
133             {
134                 "name": "aai connectivity",
135                 "status": "ok"
136             }
137         ]
138     }
139
140 **Understanding OOM deployment**
141
142 NBI uses AAF init container to generate valid server certificate, signed by ONAP Root CA.
143 This server certificate is used for TLS over HTTP.
144
145 Passing specific JAVA_OPTS to NBI SpringBoot java app will enable HTTPS.
146
147 Here are some OOM related files which could help to understand how HTTPS is set up.
148
149 Search for JAVA_OPTS in
150 https://github.com/onap/oom/blob/master/kubernetes/nbi/templates/deployment.yaml
151
152 AAF values
153 https://github.com/onap/oom/blob/master/kubernetes/nbi/values.yaml
154
155 AAF init container
156 https://github.com/onap/oom/blob/master/kubernetes/nbi/templates/configmap-aaf-add-config.yaml