Merge "correct emails"
[clamp.git] / README.md
1 # Summary\r
2 \r
3 CLAMP is a platform for designing and managing control loops. It is used to design a closed loop, configure it with specific parameters for a particular network service, then deploying and undeploying it.  Once deployed, the user can also update the loop with new parameters during runtime, as well as suspending and restarting it.\r
4 \r
5 It interacts with other systems to deploy and execute the closed loop. For example, it pushes the control loop design to the SDC catalog, associating it with the VF resource.  It requests from DCAE the instantiation of microservices to manage the closed loop flow.  Further, it creates and updates multiple policies in the Policy Engine that define the closed loop flow.\r
6 \r
7 The ONAP CLAMP platform abstracts the details of these systems under the concept of a control loop model.  The design of a control loop and its management is represented by a workflow in which all relevant system interactions take place.  This is essential for a self-service model of creating and managing control loops, where no low-level user interaction with other components is required.\r
8 \r
9 At a higher level, CLAMP is about supporting and managing the broad operational life cycle of VNFs/VMs and ultimately ONAP components itself. It will offer the ability to design, test, deploy and update control loop automation - both closed and open. Automating these functions would represent a significant saving on operational costs compared to traditional methods.\r
10 \r
11 # Developer Contact\r
12 Owner: ONAP CLAMP Dev team\r
13 Mailing List : onap-discuss@lists.onap.org\r
14 Add the following prefix to Subject on the mailing list : [CLAMP]\r
15 See here to subscribe : https://wiki.onap.org/display/DW/Mailing+Lists\r
16 \r
17 # Wiki\r
18 https://wiki.onap.org/display/DW/CLAMP+Project\r
19 \r
20 # Build\r
21 Jenkins Job: ${jenkins-joblink}\r
22 \r
23 CLAMP UI: ${cockpit-link}\r
24 \r
25 Logs: ${elk-link}\r
26 \r
27 # Docker image\r
28 \r
29 ## Building \r
30 You can use the following command to build the clamp docker image:\r
31 ```\r
32 mvn clean install -P docker\r
33 ```\r
34 \r
35 ## Deployment\r
36 Currently, the clamp docker image can be deployed with small configuration needs. Though, you might need to make small adjustments to the configuration. As clamp is spring based, you can use the SPRING_APPLICATION_JSON environment variable to update its parameters. \r
37 \r
38 ### Databases\r
39 There are two needed datasource for Clamp. By default, both will try to connect to the localhost server using the credentials available in the example SQL files. If you need to change the default database host and/or credentials, you can do it by using the following json as SPRING_APPLICATION_JSON environment variable :\r
40 Note that all others configurations can be configured in the JSON as well, \r
41 \r
42 ```json\r
43 {\r
44     "spring.datasource.cldsdb.url": "jdbc:mysql://anotherDB.onap.org:3306/cldsdb4?autoReconnect=true&connectTimeout=10000&socketTimeout=10000&retriesAllDown=3",\r
45     "spring.datasource.cldsdb.username": "admin",\r
46     "spring.datasource.cldsdb.password": "password"\r
47     \r
48     "clamp.config.dcae.inventory.url": "http://dcaegen2.host:8080",\r
49     "clamp.config.dcae.dispatcher.url": "http://dcaegen2.host:8080",\r
50     "clamp.config.policy.pdpUrl1": "https://policy-pdp.host:9091/pdp/ , testpdp, alpha123",\r
51     "clamp.config.policy.pdpUrl2": "https://policy-pdp.host:9091/pdp/ , testpdp, alpha123",\r
52     "clamp.config.policy.papUrl": "https://policy-pap.host:8443/pap/ , testpap, alpha123",\r
53     "clamp.config.policy.clientKey": "5CE79532B3A2CB4D132FC0C04BF916A7"\r
54     "clamp.config.files.sdcController":"file:/opt/clamp/config/sdc-controllers-config.json"\r
55 }\r
56 ```\r
57 ### SDC-Controllers config\r
58 \r
59 This file is a JSON that must be specified to Spring config, here is an example:\r
60 \r
61 ```json\r
62 {\r
63   "sdc-connections":{\r
64     "sdc-controller1":{\r
65         "user": "clamp",\r
66         "consumerGroup": "consumerGroup1",\r
67         "consumerId": "consumerId1",\r
68         "environmentName": "AUTO",\r
69         "sdcAddress": "localhost:8443",\r
70         "password": "b7acccda32b98c5bb7acccda32b98c5b05D511BD6D93626E90D18E9D24D9B78CD34C7EE8012F0A189A28763E82271E50A5D4EC10C7D93E06E0A2D27CAE66B981",\r
71         "pollingInterval":30,\r
72         "pollingTimeout":30,\r
73         "activateServerTLSAuth":"false",\r
74         "keyStorePassword":"",\r
75         "keyStorePath":"",\r
76         "messageBusAddresses":["dmaaphost.com"]\r
77     },\r
78     "sdc-controller2":{\r
79         "user": "clamp",\r
80         "consumerGroup": "consumerGroup1",\r
81         "consumerId": "consumerId1",\r
82         "environmentName": "AUTO",\r
83         "sdcAddress": "localhost:8443",\r
84         "password": "b7acccda32b98c5bb7acccda32b98c5b05D511BD6D93626E90D18E9D24D9B78CD34C7EE8012F0A189A28763E82271E50A5D4EC10C7D93E06E0A2D27CAE66B981",\r
85         "pollingInterval":30,\r
86         "pollingTimeout":30,\r
87         "activateServerTLSAuth":"false",\r
88         "keyStorePassword":"",\r
89         "keyStorePath":"",\r
90         "messageBusAddresses":["dmaaphost.com"]\r
91     }\r
92   }\r
93 }\r
94 ```\r
95 Multiple controllers can be configured so that Clamp is able to receive the notifications from different SDC servers.\r
96 Each Clamp existing in a cluster should have different consumerGroup and consumerId so that they can each consume the SDC notification.\r
97 The environmentName is normally the Dmaap Topic used by SDC. \r
98 If the sdcAddress is not specified or not available (connection failure) the messageBusAddresses will be used (Dmaap servers) \r
99 \r
100 ### Docker-compose\r
101 \r
102 A [docker-compose example file](extra/docker/clamp/docker-compose.yml) can be found under the [extra/docker/clamp/ folder](extra/docker/).\r
103 \r
104 Once the image has been built and is available locally, you can use the `docker-compose up` command to deploy a prepopullated database and a clamp instance available on [http://localhost:8080/designer/index.html](http://localhost:8080/designer/index.html).\r
105 \r
106 \r
107 ### Logs\r
108 \r
109 Clamp uses logback framework to generate logs. The logback.xml file cand be found under the [src/main/resources/ folder](src/main/resources). \r
110 \r
111 With the default log settings, all logs will be generated into console and into root.log file under the Clamp root folder. The root.log file is not allowed to be appended, thus restarting the clamp will result in cleaning of the old log files.\r
112 \r
113 ### Api\r
114 \r
115 You can see the swagger definition for the jaxrs apis at `/restservices/clds/v1/openapi.json`\r
116 \r
117 \r
118 ## Clamp Credentials\r
119 \r
120 There are two mechanisms that can enabled for the authentication, one or the other never both at the same time. \r
121 They can be enabled in the application.properties.\r
122 \r
123 1. AAF CA\r
124 There is a section for SSL enablement and cadi configuration (for AAF) + one spring profile to enable\r
125 \r
126 server.port=8443\r
127 server.ssl.key-store=classpath:/clds/aaf/org.onap.clamp.p12\r
128 server.ssl.key-store-password=China in the Spring\r
129 server.ssl.key-password=China in the Spring\r
130 server.ssl.key-store-type=PKCS12\r
131 server.ssl.key-alias=clamp@clamp.onap.org\r
132 server.ssl.client-auth=want\r
133 server.ssl.trust-store=classpath:/clds/aaf/truststoreONAPall.jks\r
134 server.ssl.trust-store-password=changeit\r
135 \r
136 server.http-to-https-redirection.port=8080\r
137 ....\r
138 spring.profiles.active=clamp-default,clamp-aaf-authentication,clamp-sdc-controller\r
139 ....\r
140 clamp.config.cadi.keyFile=classpath:/clds/aaf/org.onap.clamp.keyfile\r
141 clamp.config.cadi.cadiLoglevel=DEBUG\r
142 clamp.config.cadi.cadiLatitude=37.78187\r
143 clamp.config.cadi.cadiLongitude=-122.26147\r
144 clamp.config.cadi.aafLocateUrl=https://aaf.api.simpledemo.onap.org:8095\r
145 clamp.config.cadi.cadiKeystorePassword=enc:V_kq_EwDNb4itWp_lYfDGXIWJzemHGkhkZOxAQI9IHs\r
146 clamp.config.cadi.cadiTruststorePassword=enc:Mj0YQqNCUKbKq2lPp1kTFQWeqLxaBXKNwd5F1yB1ukf\r
147 clamp.config.cadi.aafEnv=DEV\r
148 clamp.config.cadi.aafUrl=https://AAF_LOCATE_URL/AAF_NS.service:2.0\r
149 clamp.config.cadi.cadiX509Issuers=CN=intermediateCA_1, OU=OSAAF, O=ONAP, C=US\r
150 \r
151 In that case a certificate must be added in the browser and is required to login properly\r
152 Please check that section to get the certificate\r
153 https://wiki.onap.org/display/DW/Control+Loop+Flows+and+Models+for+Casablanca#ControlLoopFlowsandModelsforCasablanca-Configure\r
154 \r
155 Or it can be found in the Clamp source code folder src/main/resources/clds/aaf\r
156 (Default Password: "China in the Spring")\r
157 \r
158 2. Spring authentication\r
159 It's possible to enable the spring authentication by disabling the "clamp-aaf-authentication" profile and enabling only the "clamp-default-user"\r
160 spring.profiles.active=clamp-default,clamp-default-user,clamp-sdc-controller\r
161 In that case, the credentials should be specified in `src/main/resources/clds/clds-users.json`. You might specify you own credential file by redefining the `clamp.config.files.cldsUsers` in `application.properties`.\r
162 \r
163 Passwords should be hashed using Bcrypt :\r
164 ```\r
165 # pip3 install bcrypt  # if you don't have the bcrypt python lib installed, should be done once.\r
166 # python3 -c 'import bcrypt; print(bcrypt.hashpw("password".encode(), bcrypt.gensalt(rounds=10, prefix=b"2a")))'\r
167 ```\r
168 \r
169 Default credentials are admin/password and cs0008/password.\r
170 \r
171 There is a spring file that disables the AAF and enable the Spring authentication by default. \r
172 To use it just add\r
173 \r
174 --spring.config.name=application-noaaf\r
175 \r
176 to the jvm parameters. This file is available by default in the java classpath resource folder.