aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: 07c64a2b31c7a5e5bbb2085f1228cc6e859c20af (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
# VES OpenApi Manager

# Description
This application should partially validate incoming service distributions in SDC. It validates each artifact of type
VES_EVENT. Its purpose is to check whether schemaReferences of stndDefined events included in VES_EVENT artifacts are
matching the schemas which VES Collector contains.

# Instructions

## How to prepare environment for local ves-openapi-manager with lab connection

1. Connect to lab and expose ports of message-router service by setting *spec.type* to NodePort.

2. Add to /etc/hosts new entry:
```
<lab_worker_node_ip> sdc-be.onap
```

3. Get exposed port of 3904 internal port of message-router.
   
   Set up connection configuration in *environment.config* file.
   - MESSAGE_ROUTER_PORT - exposed port of message-router.
   - RKE_IP - IP of lab RKE node.
   - WORKER_IP - IP of lab worker node.
   - SSH_LAB_KEY_PATH - path to lab SSH key.
    
4. Local port forwarding is required to set up proper connection from local environment to message-router on the lab.
   
   Run this to enable port-forwarding (CTRL+C to end):
   ```
   make port-forwarding
   ```
## How to locally start ves-openapi-manager
Currently, there are two common ways to run application, both described below.

### Start in IntelliJ
Right click on Main class, then Run or Debug button.

### Start as Docker container
Run:
```
make all
```

### Lab connection verification
Correctly connected to lab application should print logs:
```
distribution client initialized successfuly
```
and
```
distribution client started successfuly
```

## How to use ves-openapi-manager
After preparing environment, starting ves-openapi-manager and successful connection to lab, application will listen for
service distributions taking place in SDC. 

1. In SDC UI, create Service with Resource (e.g. PNF) containing VES_EVENT artifact.
2. (Re)distribute created Service.

When distribution takes place, ves-openapi-manager downloads each VES_EVENT artifact to validate its stndDefined events.

Results of validation are visible in two places:
- In SDC UI in Service -> Distributions view under specific distribution as component *ves-openapi-manager*.
  It might take few minutes to show results after service distribution.
- In logs of ves-openapi-manager, right after validation takes place.

## Docker image

### Building
There are at least two ways to build docker image.

Using makefile:
```
make build docker
```

Direct creation with mvn: 
```
mvn clean package docker:build
```

Image will be named: *onap/org.onap.dcaegen2.platform.ves-openapi-manager*