5fce7b887c94b5eaa4e81a6a8cc4be465f476a02
[externalapi/nbi.git] / docs / installation / installation.rst
1 .. This work is licensed under
2 .. a Creative Commons Attribution 4.0 International License.
3 .. http://creativecommons.org/licenses/by/4.0
4 .. Copyright 2018 ORANGE
5
6
7 Installation
8 ============
9
10 This document describes local build and installation for development purpose
11
12 Build
13 -----
14
15 Requirements
16
17 * Java 8
18 * Maven
19 * port 8080 should be free, used by tests
20
21 Build
22 ::
23
24     mvn clean package
25
26 Run
27 ---
28
29 **Maven**
30
31 Requirements
32
33 * Java 8
34 * Maven
35 * MongoDB
36 * MariaDB
37
38 Review and edit *src/main/resources/application.properties*
39
40 Defaults
41
42     Mongo, host=localhost, port=27017, database=ServiceOrderDB
43
44     Mariadb, url=jdbc:mariadb://localhost:3306/nbi, username=root, password=secret
45
46 Run
47 ::
48
49     mvn spring-boot:run
50
51 **Docker**
52
53 Requirements
54
55 * Docker
56 * Docker-compose
57
58 Edit *docker-compose.yml* to select previous generated local build, replace::
59
60     image: ${NEXUS_DOCKER_REPO}/onap/externalapi/nbi:latest
61
62 by::
63
64     build: .
65
66 Run::
67
68     docker-compose up -d mongo mariadb
69
70     docker-compose up --build -d nbi
71
72 Logs::
73
74     docker-compose logs -f nbi
75
76
77 Test
78 ----
79
80 **Healthcheck**
81
82 http://localhost:8080/nbi/api/v1/status
83
84 You should get::
85
86     {
87         "name": "nbi",
88         "status": "ok",
89         "version": "v1"
90     }
91
92 **Play with RESTclient**
93
94 You can also test NBI with `VisualStudio RestClient plugin <https://github.com/Huachao/vscode-restclient>`_
95
96 See the *restclient* package at root level to find *.vscode/settings.json*
97 configuration file and */json/* package with samples requests that can be run.
98
99 **Play with Postman**
100
101 A collection is available here *docs/offeredapis/postman*
102