Merge "Upversion Spring-Boot to 1.5.19.RELEASE"
[aai/babel.git] / README.md
1 # ONAP aai/babel
2
3 ## Introduction
4 Babel is a microservice in the AAI project which can be used by clients that work with TOSCA CSAR files.
5
6 It parses TOSCA YAML files extracted from a CSAR payload and generates XML files containing AAI Model data.
7
8 ## Building Babel
9 The Babel service can be built with Maven, e.g. by issuing the command `mvn clean install`  
10
11 Maven will produce the following artifacts in the "target" folder:
12
13 * babel.jar
14 * babel-client.jar
15 * Dockerfile
16 * start.sh
17
18 Maven will install the following artifacts in the local repository:
19 * babel-{version}.jar
20 * babel-{version}-client.jar
21
22 To create the docker image run:
23 docker build -t aai/babel target
24
25 ## Babel Client
26 The project will build a client jar which can be used by clients invoking the Babel service.   
27
28 The client jar contains two objects that are used in the Babel service API.
29
30 BabelRequest is used to supply the inputs into the Babel service.
31 BabelArtifact is the response artifact in the list of artifacts returned from the Babel service.
32
33 ### Deploying The Microservice 
34
35 Push the Docker image that you have built to your Docker repository and pull it down to the location that you will be running Babel from.
36
37 **Create the following directories on the host machine:**
38
39     ./logs
40     ./opt/app/babel/appconfig
41     ./opt/app/babel/appconfig/auth
42
43 You will be mounting these as data volumes when you start the Docker container.  For examples of the files required in these directories, see the aai/test/config repository (https://gerrit.onap.org/r/#/admin/projects/aai/test-config)
44
45 **Populate these directories as follows:**
46
47 ##### Contents of /opt/app/babel/appconfig
48
49 The following file must be present in this directory on the host machine:
50
51 The purpose of this configuration directory is to maintain configuration files specific to authentication/authorization for the _Babel_ service.
52 The following files must be present in this directory on the host machine:
53
54 _babel-auth.properties_
55
56     auth.policy.file=/auth/auth_policy.json
57     auth.authentication.disable=false
58
59
60 _artifact-generator.properties_ <br />
61 Contains model invariants ids used by SDC artifact generator library
62
63 _logback.xml_
64
65 Logging configuration.
66
67 ##### Contents of /opt/app/babel/appconfig/auth 
68 _auth_policy.json_
69  
70 Create a policy file defining the roles and users that will be allowed to access _Babel_ service.  This is a JSON format file which will look something like the following example:
71  
72      {
73          "roles": [
74              {
75                  "name": "admin",
76                  "functions": [
77                      {
78                          "name": "search", "methods": [ { "name": "GET" },{ "name": "DELETE" }, { "name": "PUT" }, { "name": "POST" } ]
79                      }
80                  ],
81                  "users": [
82                     {
83                          "username": "CN=babeladmin, OU=My Organization Unit, O=, L=Sometown, ST=SomeProvince, C=CA"
84                      }    
85                  ]
86              }
87          ]
88      }
89  
90  _tomcatkeystore_
91  
92 Create a keystore with this name containing whatever CA certificates that you want your instance of the _Babel_ service to accept for HTTPS traffic.
93
94
95 ## Dependency Information
96
97 To include the Babel service client jar in your project add the following maven dependency to your project's pom:
98
99                 <dependency>
100                         <groupId>org.onap.aai</groupId>
101                         <artifactId>babel</artifactId>
102                         <version>*</version>
103                         <classifier>client</classifier>
104                 </dependency>
105