Remove Postman collection
[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 OOM Context
93 -----------
94
95 **Healthcheck**
96
97 Running a standalone test::
98
99     curl "https://nbi.api.simpledemo.onap.org:30274/nbi/api/v4/status"
100
101     {
102         "name": "nbi",
103         "status": "ok",
104         "version": "v4"
105     }
106
107 Running an integration test with SO, SDC, DMAAP, AAI::
108
109     curl "https://nbi.api.simpledemo.onap.org:30274/nbi/api/v4/status?fullStatus=true"
110
111     {
112         "name": "nbi",
113         "status": "ok",
114         "version": "v4",
115         "components": [
116             {
117                 "name": "so connectivity",
118                 "status": "ok"
119             },
120             {
121                 "name": "sdc connectivity",
122                 "status": "ok"
123             },
124             {
125                 "name": "dmaap connectivity",
126                 "status": "ok"
127             },
128             {
129                 "name": "aai connectivity",
130                 "status": "ok"
131             }
132         ]
133     }
134
135 **Understanding OOM deployment**
136
137 NBI uses AAF init container to generate valid server certificate, signed by
138 ONAP Root CA. This server certificate is used for TLS over HTTP.
139
140 Passing specific JAVA_OPTS to NBI SpringBoot java app will enable HTTPS.
141
142 Here are some OOM related files which could help to understand how HTTPS is
143 set up.
144
145 Search for JAVA_OPTS in
146 https://github.com/onap/oom/blob/master/kubernetes/nbi/templates/deployment.yaml
147
148 AAF values
149 https://github.com/onap/oom/blob/master/kubernetes/nbi/values.yaml
150
151 AAF init container
152 https://github.com/onap/oom/blob/master/kubernetes/nbi/templates/configmap-aaf-add-config.yaml