correct some rst files
[externalapi/nbi.git] / docs / installation / installation.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. Copyright 2018 ORANGE
4
5
6 Installation
7 ============
8
9
10
11 Environment
12 -----------
13
14 **Locally**
15
16 Ensure that you have a MongoDB and MariaDB instance running and properly configured in *application.properties* file.
17 Run *Application.java* class in your favorite IDE
18
19 Or through a terminal, ensure that your maven installation is works and run *mvn spring-boot:run* command to start the appication.
20
21
22 **Docker**
23
24 Requirements: `Docker engine <https://docs.docker.com/engine/>`_ and `docker-compose <https://docs.docker.com/compose/>`_.
25
26 To start the application:
27     1. Generate the application .jar file: `$ mvn clean package`
28     2. Configure the **.env** file
29     3. Start the *MariaDB* and *MongoDB* services: `$ docker-compose up -d mongo mariadb`
30     4. Build and start the *NBI* service: `$ docker-compose up --build -d nbi`
31
32 You can view the log output of the application with the following command:
33
34 `$ docker-compose logs -f nbi`
35
36
37 Steps
38 -----
39
40 **Testing**
41 When the app is running, you can access the API at :samp:`http://yourhostname:8080/nbi/api/v1/` and fill the url with the name of the resources you asking for (/serviceSpecification, /service, /serviceOrder or /status)
42 You can run a test by using `VisualStudio RestClient plugin <https://github.com/Huachao/vscode-restclient>`_
43 See the *restclient* package at root level to find *.vscode/settings.json* configuration file and */json/* package with samples requests that can be run.
44 You can also trigger these endpoints with any RESTful client or automation framework.
45