commit | 60457e41054465e9fa10c8e6bfdbfa62a45d1f0a | [log] [tgz] |
---|---|---|
author | mark.j.leonard <mark.j.leonard@gmail.com> | Fri Mar 29 10:50:04 2019 +0000 |
committer | mark.j.leonard <mark.j.leonard@gmail.com> | Fri Mar 29 16:13:12 2019 +0000 |
tree | 009055c484b0f7c69cf2a3ee25f2779c7541aa47 | |
parent | 5f1b6e4eb654639de6aaae9b7d862eb01b991f55 [diff] |
Additional null checks and comments Add defensive coding to check for possible null pointer values, thus preventing certain potential runtime exceptions. Fix some minor spelling inconsistencies. Refactor some method signatures and update the Javadoc. Reformat Resource toString() method to avoid lengthy String concatenation and duplicated separators. Change-Id: I4b01eb844700e00d0c909bcc5fa2dbc91d5149e4 Issue-ID: AAI-2281 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
Babel is a microservice in the AAI project which can be used by clients that work with TOSCA CSAR files.
It parses TOSCA YAML files extracted from a CSAR payload and generates XML files containing AAI Model data.
The Babel service can be built with Maven, e.g. by issuing the command mvn clean install
Maven will produce the following artifacts in the "target" folder:
Maven will install the following artifacts in the local repository:
To create the docker image run: docker build -t aai/babel target
The project will build a client jar which can be used by clients invoking the Babel service.
The client jar contains two objects that are used in the Babel service API.
BabelRequest is used to supply the inputs into the Babel service. BabelArtifact is the response artifact in the list of artifacts returned from the Babel service.
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.
Create the following directories on the host machine:
./logs ./opt/app/babel/appconfig ./opt/app/babel/appconfig/auth
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)
Populate these directories as follows:
The following file must be present in this directory on the host machine:
The purpose of this configuration directory is to maintain configuration files specific to authentication/authorization for the Babel service. The following files must be present in this directory on the host machine:
babel-auth.properties
auth.policy.file=/auth/auth_policy.json auth.authentication.disable=false
artifact-generator.properties
Contains model invariants ids used by SDC artifact generator library
logback.xml
Logging configuration.
auth_policy.json
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:
{ "roles": [ { "name": "admin", "functions": [ { "name": "search", "methods": [ { "name": "GET" },{ "name": "DELETE" }, { "name": "PUT" }, { "name": "POST" } ] } ], "users": [ { "username": "CN=babeladmin, OU=My Organization Unit, O=, L=Sometown, ST=SomeProvince, C=CA" } ] } ] }
tomcatkeystore
Create a keystore with this name containing whatever CA certificates that you want your instance of the Babel service to accept for HTTPS traffic.
To include the Babel service client jar in your project add the following maven dependency to your project's pom:
<dependency> <groupId>org.onap.aai</groupId> <artifactId>babel</artifactId> <version>*</version> <classifier>client</classifier> </dependency>