aboutsummaryrefslogtreecommitdiffstats
path: root/docs/installation/installation.rst
blob: 95b7279939fbba3dfdc7ea54fbe2820a516a327c (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
.. SPDX-License-Identifier: CC-BY-4.0
.. Copyright 2018 ORANGE


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

This document describes local build and installation for development purpose

Build
-----

Requirements

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

Build
::

    mvn clean package

Run
---

**Maven**

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

**Docker**

Requirements

* Docker
* Docker-compose
* Free ports 8080 and 8443

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


Test
----

**Healthcheck**

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

and

https://localhost:8443/nbi/api/v4/status

You should get::

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

**Play with RESTclient**

You can also test NBI with `VisualStudio RestClient plugin <https://github.com/Huachao/vscode-restclient>`_

See the *restclient* package at root level to find *.vscode/settings.json*
configuration file and */json/* package with samples requests that can be run.

**Play with Postman**

A collection is available here *docs/offeredapis/postman*