Merge "Add additional fields validation report"
[aai/data-router.git] / README.md
1 # Synapse Micro Service
2
3 ## Overview
4 The Synapse microservice (data router service) acts as a message broker between different sources of information and business logic within the context of AAI. The goal is to provide an extensible framework that can stitch sources of data and business logic together to satisfy use cases through configuration and minimal coding.
5
6 Please refer to the following sub-sections for more detailed information:
7
8 [High Level Concepts](./CONCEPTS.md) - Discussion of the high level concepts and building blocks of the _SYNAPSE_ Data Router service.
9
10 [Synapse Functions](./FUNCTIONS.md) - Discussion of the high level use cases that Synapse can fulfill upon deployment and configuration
11
12 ## Getting Started
13
14 ### Building The Micro Service
15
16 After cloning the project, execute the following Maven command from the project's top level directory to build the project:
17
18     > mvn clean install
19
20 Now, you can build your Docker image:
21
22     > docker build -t onap/datarouter-service target 
23     
24 ### Deploying The Micro Service 
25
26 Push the Docker image that you have built to your Docker repository and pull it down to the location that you will be running Synapse from.
27
28 Note that in order to take advantage of some of the base functionality of Synapse, you will need to have the following:
29
30 * optional access to DMaaP in order to pull data off of configured topics
31 * optional access to a search service installation in order to be able to write indexable data 
32
33
34 **Create the following directories on the host machine:**
35
36     /logs
37     /opt/app/datarouter-service/appconfig
38     
39 You will be mounting these as data volumes when you start the Docker container.
40
41 **Populate these directories as follows:**
42
43 ##### Contents of /opt/app/datarouter-service/appconfig
44
45 The purpose of this configuration directory is to maintain general configuration files for the _Synapse_ data routing service.
46 The following files must be present in this directory on the host machine:
47     
48 _data-router.properties_
49
50 This file currently requires no configuration but should still remain for future use cases
51     
52 ##### Contents of the /opt/app/datarouter-service/app-config/auth Directory
53
54 The purpose of this configuration directory is to maintain configuration files specific to authentication/authorization for the _Synapse_ data routing service.
55 The following files must be present in this directory on the host machine:
56
57 _data-router\_policy.json_
58
59 Create a policy file defining the roles and users that will be allowed to access _Synapse_ data routing service.  This is a JSON format file which will look something like the following example:
60
61     {
62         "roles": [
63             {
64                 "name": "admin",
65                 "functions": [
66                     {
67                         "name": "search", "methods": [ { "name": "GET" },{ "name": "DELETE" }, { "name": "PUT" }, { "name": "POST" } ]
68                     }
69                 ],
70                 "users": [
71                     {
72                         "username": "CN=synapseadmin, OU=My Organization Unit, O=, L=Sometown, ST=SomeProvince, C=CA"
73                     }    
74                 ]
75             }
76         ]
77     }
78
79 _tomcat\_keystore_
80
81 Create a keystore with this name containing whatever CA certificates that you want your instance of the _Synapse_ data routing service to accept for HTTPS traffic.
82
83 _search-certificate_
84
85 Provide a certificate that will allow the _Synapse_ data routing service to communicate with the configured search service via HTTPS
86
87 ##### Contents of the /opt/app/datarouter-service/app-config/model Directory
88
89 The purpose of this configuration directory is to maintain model configuration files for the _Synapse_ data routing service.
90 The following files must be present in this directory on the host machine:
91
92 _aai_oxm_(.*).xml_
93
94 Any AAI OXM model files must be placed in the model directory and be named with the aai_oxm_ prefix. ex: aai_oxm_v9.xml. These files are used for use cases that are model driven.
95
96 ##### Contents of the /opt/app/datarouter-service/dynamic/conf Directory
97
98 The purpose of this configuration directory is to maintain configuration spring bean files specific to _Synapse_ use cases. Please refer to [Synapse Functions](./FUNCTIONS.md) for information on specific use cases.
99
100
101 ##### Contents of the /opt/app/datarouter-service/dynamic/routes Directory
102
103 The purpose of this configuration directory is to maintain Camel route files specific to _Synapse_ use cases.  Please refer to [Synapse Functions](./FUNCTIONS.md) for information on specific use cases.
104
105 **Start the service:**
106
107 You can now start the Docker container for the _Synapse_ data router service, in the following manner:
108
109         docker run -d \
110             -p 9502:9502 \
111                 -e CONFIG_HOME=/opt/app/datarouter-service/config/ \
112                 -e KEY_STORE_PASSWORD=OBF:{{obfuscated password}} \
113                 -e KEY_MANAGER_PASSWORD=OBF:{{obfuscated password}} \
114                 -e MAX_HEAP={{jvmmaxheap}} \
115             -v /logs:/opt/aai/logroot/AAI-DR \
116             -v /opt/app/datarouter-service/appconfig:/opt/app/datarouter-service/config \
117             --name datarouter-service \
118             {{your docker repo}}/datarouter-service
119     
120 Where,
121
122     {{your docker repo}} = The Docker repository you have published the Synapse Data Router Service image to.
123     {{obfuscated password}} = The password for your key store/key manager after running it through the Jetty obfuscation tool.
124     {{jvmmaxheap}} = The max heap size of the JVM for the microservice
125
126  
127  
128