Merge "Docs for PDP-PAP interaction"
[policy/parent.git] / docs / clamp / clamp / clamp.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. Copyright (c) 2017-2021 AT&T Intellectual Property. All rights reserved.
4 .. _clamp-builtin-label:
5
6 Policy/CLAMP - Control Loop Automation Management Platform
7 ==========================================================
8 .. High level architecture, design, and packaging information for release planning and delivery.
9
10 .. include:: architecture.rst
11
12
13 Offered APIs
14 ------------
15 The list of APIs that Policy/CLAMP offers can be found on the following table:
16
17 .. |pdf-icon| image:: images/pdf.png
18               :width: 40px
19
20 .. |swagger-icon| image:: images/swagger.png
21                    :width: 40px
22
23 .. |html-icon| image:: images/html.png
24                :width: 40px
25
26 .. csv-table::
27    :header: "|Swagger-icon|", "|html-icon|", "|pdf-icon|"
28    :widths: 60,60,60
29
30    "swagger json file", "html doc", "pdf doc"
31    ":download:`link <swagger/swagger.json>`", ":download:`link <swagger/swagger.html>`", ":download:`link <swagger/swagger.pdf>`"
32
33
34 Consumed APIs
35 -------------
36 Policy/CLAMP uses the API's exposed by the following ONAP components:
37
38 - SDC : REST based interface exposed by the SDC, Distribution of service to DCAE
39 - DCAE: REST based interface exposed by DCAE, Common Controller Framework, DCAE microservices onboarded (TCA, Stringmatch, Holmes (optional))
40 - Policy Core: REST based interface, Policy Core engine target both XACML and Drools PDP, Policy Engine trigger operations to App-C/VF-C/SDN-C
41 - CDS: REST based interface, to retrieve list of operations/actions with their corresponding payload at runtime for Operational Policies where the field 'actor' is 'CDS'.
42
43 Delivery
44 --------
45 Policy/CLAMP component is composed of a UI layer and a backend layer, each layer having its own container.
46 Policy/CLAMP also requires a database instance with 1 DB, it uses MariaDB, which is the same DB as for the core Policy.
47
48 .. |clamp-policy-archi| image:: images/clamp-policy_archi.png
49
50 |clamp-policy-archi|
51
52 Logging & Diagnostic Information
53 --------------------------------
54 CLAMP uses logback framework to generate logs. The logback.xml file can be found under the [src/main/resources/ folder](src/main/resources).
55
56 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.
57
58
59 .. _index-clamp-installation:
60
61 Installation
62 ------------
63 A [docker-compose example file](extra/docker/clamp/docker-compose.yml) can be found under the [extra/docker/clamp/ folder](extra/docker/).
64
65 Once the image has been built and is available locally, you can use the `docker-compose up` command to deploy a pre-populated database and a CLAMP instance available on [https://localhost:3000](https://localhost:3000).
66
67 Configuration
68 -------------
69 .. Where are they provided?
70 .. What are parameters and values?
71
72
73 Currently, the CLAMP docker images 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.
74
75 .. TODO detail config parameters and the usage
76
77
78 There are one datasource for Clamp. By default, it 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 :
79
80 .. code-block:: json
81
82     {
83         "spring.datasource.cldsdb.url": "jdbc:mariadb:sequential://clampdb.{{ include "common.namespace" . }}:3306/cldsdb4?autoReconnect=true&connectTimeout=10000&socketTimeout=10000&retriesAllDown=3",
84         "clamp.config.files.sdcController": "file:/opt/clamp/sdc-controllers-config.json",
85         "clamp.config.dcae.inventory.url": "https://inventory.{{ include "common.namespace" . }}:8080",
86         "clamp.config.dcae.dispatcher.url": "https://deployment-handler.{{ include "common.namespace" . }}:8443",
87         "clamp.config.dcae.deployment.url": "https://deployment-handler.{{ include "common.namespace" . }}:8443",
88         "clamp.config.dcae.deployment.userName": "none",
89         "clamp.config.dcae.deployment.password": "none",
90         "clamp.config.policy.api.url": "https://policy-api.{{ include "common.namespace" . }}:6969",
91         "clamp.config.policy.api.userName": "healthcheck",
92         "clamp.config.policy.api.password": "zb!XztG34",
93         "clamp.config.policy.pap.url": "https://policy-pap.{{ include "common.namespace" . }}:6969",
94         "clamp.config.policy.pap.userName": "healthcheck",
95         "clamp.config.policy.pap.password": "zb!XztG34",
96         "clamp.config.cadi.aafLocateUrl": "https://aaf-locate.{{ include "common.namespace" . }}:8095",
97         "com.att.eelf.logging.path": "/opt/clamp",
98         "com.att.eelf.logging.file": "logback.xml"
99     }
100
101 SDC-Controllers config
102 ----------------------
103 This file is a JSON that must be specified to Spring config, here is an example:
104
105 .. code-block:: json
106
107     {
108      "sdc-connections":{
109        "sdc-controller1":{
110            "user": "clamp",
111            "consumerGroup": "consumerGroup1",
112            "consumerId": "consumerId1",
113            "environmentName": "AUTO",
114            "sdcAddress": "localhost:8443",
115            "password": "b7acccda32b98c5bb7acccda32b98c5b05D511BD6D93626E90D18E9D24D9B78CD34C7EE8012F0A189A28763E82271E50A5D4EC10C7D93E06E0A2D27CAE66B981",
116            "pollingInterval":30,
117            "pollingTimeout":30,
118            "activateServerTLSAuth":"false",
119            "keyStorePassword":"",
120            "keyStorePath":"",
121            "messageBusAddresses":["dmaaphost.com"]
122        },
123        "sdc-controller2":{
124            "user": "clamp",
125            "consumerGroup": "consumerGroup1",
126            "consumerId": "consumerId1",
127            "environmentName": "AUTO",
128            "sdcAddress": "localhost:8443",
129            "password": "b7acccda32b98c5bb7acccda32b98c5b05D511BD6D93626E90D18E9D24D9B78CD34C7EE8012F0A189A28763E82271E50A5D4EC10C7D93E06E0A2D27CAE66B981",
130            "pollingInterval":30,
131            "pollingTimeout":30,
132            "activateServerTLSAuth":"false",
133            "keyStorePassword":"",
134            "keyStorePath":"",
135            "messageBusAddresses":["dmaaphost.com"]
136        }
137      }
138     }
139
140 Multiple controllers can be configured so that Clamp is able to receive the notifications from different SDC servers.
141 Each Clamp existing in a cluster should have different consumerGroup and consumerId so that they can each consume the SDC notification.
142 The environmentName is normally the Dmaap Topic used by SDC.
143 If the sdcAddress is not specified or not available (connection failure) the messageBusAddresses will be used (Dmaap servers)
144
145 Administration
146 --------------
147
148 A user can access Policy/CLAMP UI at the following URL : https://localhost:3000.
149 (in this URL 'localhost' must be replaced by the actual host where Policy/CLAMP has been installed if it is not your current localhost)
150 For OOM, the URL is https://<host-ip>:30258
151
152 .. code-block:: html
153
154    - Without AAF, the credentials are
155      Default username : admin
156      Default password : password
157
158    - With AAF enabled, the certificate p12 must be added to the browser
159      ca path: src/main/resources/clds/aaf/org.onap.clamp.p12, password "China in the Spring"
160      Or get it from this page : https://wiki.onap.org/display/DW/Control+Loop+Flows+and+Models+for+Casablanca
161
162 Human Interfaces
163 ----------------
164 .. Basic info on the interface type, ports/protocols provided over, etc.
165
166 User Interface - serve to configure control loop
167 Policy/CLAMP UI is used to configure the Control Loop designed and distributed by SDC. From that UI it's possible to distribute the configuration policies and control the life-cycle of the DCAE Micro Services.
168 Policy/CLAMP UI is also used to manage Policies outside of a Control Loop.
169
170 The following actions are done using the UI:
171
172 * Design a control loop flow by selecting a predefined template from a list
173   (a template is an orchestration chain of Micro-services, so the template
174   defines how the micro-services of the control loop are chained together)
175
176 * Give value to the configuration the parameters of each micro-service of
177   the control loop
178
179 * Select the service and VNF(of that service) to which the control loop
180   will be attached
181
182 * Configure the operational policy(the actual operation resulting from
183   the control loop)
184
185 * Send the “TOSCA” blueprint parameters that will be used by DCAE to start the
186   control loop (The blueprint will be sent first to SDC and SDC will
187   publish it to DCAE)
188
189 * Trigger the deployment of the Control loop in DCAE
190
191 * Control (start/stop) the operation of the control loop in DCAE
192
193 HealthCheck API - serve to verify CLAMP status (see offered API's section)
194 * https://<host-ip>:8443/restservices/clds/v1/healthcheck
195 This one does not require the certificate
196
197 Walk-through can be found here: https://wiki.onap.org/display/DW/CLAMP+videos
198
199 .. toctree::
200    :maxdepth: 1
201    :titlesonly:
202
203    CLAMP User Guide <user-guide.rst>