aboutsummaryrefslogtreecommitdiffstats
path: root/docs/installation/installation.rst
blob: 38ecb3c980250802a6211d29a1b50f819c633731 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
.. SPDX-License-Identifier: CC-BY-4.0
.. Copyright 2018 ORANGE


Installation
============

This document describes local installation for development purpose
It also describes some keypoints for understanding NBI in OOM context

Build
-----

Requirements

* Java 11
* Maven
* free port 8080, used by tests

Build::

    mvn clean package

Alternative 1 run SpringBoot application
----------------------------------------

Requirements

* Java 11
* Maven
* MongoDB
* MariaDB

Review and edit *src/main/resources/application.properties*

Defaults

    Mongo, host=localhost, port=27017, database=ServiceOrderDB

    Mariadb, url=jdbc:mariadb://localhost:3306/nbi, username=root,
    password=secret

Run::

    mvn spring-boot:run

Alternative 2 run docker
------------------------

Requirements

* Docker
* Docker-compose
* Free ports 8080

Edit *docker-compose.yml* to select previous generated local build, replace::

    image: ${NEXUS_DOCKER_REPO}/onap/externalapi/nbi:latest

by::

    build: .

Run::

    docker-compose up -d mongo mariadb

    docker-compose up --build -d nbi

Logs::

    docker-compose logs -f nbi


Local tests
-----------

Status is available at http://localhost:8080/nbi/api/v4/status

Running a standalone test::

    curl "http://localhost:8080/nbi/api/v4/status"

You should get::

    {
        "name": "nbi",
        "status": "ok",
        "version": "v4"
    }

Play with Postman
-----------------

A full collection of requests is available in *docs/offeredapis/postman* for inspiration

OOM Context
-----------

**Healthcheck**

Running a standalone test::

    curl "https://nbi.api.simpledemo.onap.org:30274/nbi/api/v4/status"

    {
        "name": "nbi",
        "status": "ok",
        "version": "v4"
    }

Running an integration test with SO, SDC, DMAAP, AAI::

    curl "https://nbi.api.simpledemo.onap.org:30274/nbi/api/v4/status?fullStatus=true"

    {
        "name": "nbi",
        "status": "ok",
        "version": "v4",
        "components": [
            {
                "name": "so connectivity",
                "status": "ok"
            },
            {
                "name": "sdc connectivity",
                "status": "ok"
            },
            {
                "name": "dmaap connectivity",
                "status": "ok"
            },
            {
                "name": "aai connectivity",
                "status": "ok"
            }
        ]
    }

**Understanding OOM deployment**

NBI uses AAF init container to generate valid server certificate, signed by ONAP Root CA.
This server certificate is used for TLS over HTTP.

Passing specific JAVA_OPTS to NBI SpringBoot java app will enable HTTPS.

Here are some OOM related files which could help to understand how HTTPS is set up.

Search for JAVA_OPTS in
https://github.com/onap/oom/blob/master/kubernetes/nbi/templates/deployment.yaml

AAF values
https://github.com/onap/oom/blob/master/kubernetes/nbi/values.yaml

AAF init container
https://github.com/onap/oom/blob/master/kubernetes/nbi/templates/configmap-aaf-add-config.yaml