0d5e4e992cbb1b2ad80c3c5bc26fd702266ce4a0
[aai/model-loader.git] / Readme.md
1 # Introduction
2
3 The A&AI Model Loader Service is an application that facilitates
4 distribution, ingestion of new service and resource models, and vnf
5 catalogs from the SDC to the A&AI.
6
7 ## Features
8
9 The Model Loader:
10
11 * registers with the SDC to receive notification events 
12 * polls the UEB/DMaap cluster for notification events
13 * downloads artifacts from SDC upon receipt of a distribution event
14 * pushes distribution components to A&AI
15                     
16 ## Compiling Model Loader
17
18 Model Loader can be compiled by running `mvn clean install`
19 A Model Loader docker image can be created by running `docker build -t openecomp/model-loader target`
20
21 ## Running Model Loader 
22
23 ### Deploying The Micro Service 
24
25 Push the Docker image that you have built to your Docker repository and pull it down to the location that you will be running the search service from.
26
27 **Create the following directories on the host machine:**
28
29     ./logs
30     ./opt/app/model-loader/appconfig
31     ./opt/app/model-loader/appconfig/auth
32     
33 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)
34
35 **Populate these directories as follows:**
36
37 #### Contents of /opt/app/model-loader/appconfig
38
39 The following file must be present in this directory on the host machine:
40     
41 _model-loader.properties_  
42     # Always false.  TLS Auth currently not supported 
43     ml.distribution.ACTIVE_SERVER_TLS_AUTH=false
44     
45     # Address/port of the SDC
46     ml.distribution.ASDC_ADDRESS=<SDC-Hostname>:8443
47     
48     # DMaaP consumer group.  
49     ml.distribution.CONSUMER_GROUP=aai-ml-group
50     
51     # DMaaP consumer ID
52     ml.distribution.CONSUMER_ID=aai-ml
53     
54     # SDC Environment Name.  This must match the environment name configured on the SDC
55     ml.distribution.ENVIRONMENT_NAME=<Environment Name>
56     
57     # Currently not used
58     ml.distribution.KEYSTORE_PASSWORD=
59     
60     # Currently not used
61     ml.distribution.KEYSTORE_FILE=
62     
63     # Obfuscated password to connect to the SDC.  To obtain this value, use the following Jetty library to 
64     # obfuscate the cleartext password:  http://www.eclipse.org/jetty/documentation/9.4.x/configuring-security-secure-passwords.html
65     ml.distribution.PASSWORD=OBF:<password>
66     
67     # How often (in seconds) to poll the DMaaP cluster for new model events
68     ml.distribution.POLLING_INTERVAL=<integer>
69     
70     # Timeout value (in seconds) when polling DMaaP for new model events
71     ml.distribution.POLLING_TIMEOUT=<integer>
72     
73     # Username to use when connecting to the SDC
74     ml.distribution.USER=<username>
75     
76     # Artifact type we want to download from the SDC (the values below will typically suffice)
77     ml.distribution.ARTIFACT_TYPES=MODEL_INVENTORY_PROFILE,MODEL_QUERY_SPEC,VNF_CATALOG
78     
79     # List of message bus addresses on which to listen for distribution events
80     ml.distribution.MSG_BUS_ADDRESSES=<host1>,<host2>
81
82     # URL of the A&AI
83     ml.aai.BASE_URL=https://<AAI-Hostname>:8443
84     
85     # A&AI endpoint to post models
86     ml.aai.MODEL_URL=/aai/v*/service-design-and-creation/models/model/
87     
88     # A&AI endpoint to post named queries
89     ml.aai.NAMED_QUERY_URL=/aai/v*/service-design-and-creation/named-queries/named-query/
90     
91     # A&AI endpoint to post vnf images
92     ml.aai.VNF_IMAGE_URL=/aai/v8/service-design-and-creation/vnf-images
93     
94     # Name of certificate to use in connecting to the A&AI
95     ml.aai.KEYSTORE_FILE=aai-os-cert.p12
96     
97     # Obfuscated keystore password to connect to the A&AI.  This is only required if using 2-way SSL (not basic auth).
98     # To obtain this value, use the following Jetty library to obfuscate the cleartext password:
99     # http://www.eclipse.org/jetty/documentation/9.4.x/configuring-security-secure-passwords.html
100     ml.aai.KEYSTORE_PASSWORD=OBF:<password>
101     
102     # Name of user to use when connecting to the A&AI.  This is only required if using basic auth (not 2-way SSL).
103     ml.aai.AUTH_USER=<username>
104     
105     # Obfuscated password to connect to the A&AI.  This is only required if using basic auth (not 2-way SSL).
106     # To obtain this value, use the following Jetty library to obfuscate the cleartext password:
107     # http://www.eclipse.org/jetty/documentation/9.4.x/configuring-security-secure-passwords.html
108     ml.aai.AUTH_PASSWORD=OBF:<password>
109     
110
111
112 ##### Contents of the /opt/app/model-loader/app-config/auth Directory
113
114 The following files must be present in this directory on the host machine:
115
116 _aai-os-cert.p12_
117
118 The certificate used to connected to the A&AI
119
120 **Start the service:**
121
122 You can now start the Docker container for the _Search Data Service_, in the following manner:
123
124         docker run -d \
125                 -e CONFIG_HOME=/opt/app/model-loader/config/ \
126             -v /logs:/logs \
127             -v /opt/app/model-loader/appconfig:/opt/app/model-loader/config \
128             --name model-loader \
129             {{your docker repo}}/model-loader
130     
131 Where,
132
133     {{your docker repo}} = The Docker repository you have published your image to.