Remove bad url
[clamp.git] / docs / user-guide.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-2018 AT&T Intellectual Property.  All rights reserved.
4
5 Control loop in CLAMP
6 ---------------------
7 There is 2 control loop levels in CLAMP:
8
9 - Control loop template: This is created from the DCAE blueprint (designed in the DCAE designer), and distributed by SDC to CLAMP.
10 - Control loop instance: Based on the template, it represents a physical control loop in the platform related to a service and a VNF.
11     This is created in CLAMP when receiving the SDC notification, as this one is related to a specific service/vnf.
12
13 There is no way to design a control loop from scratch in CLAMP, you can only configure it and manage its life-cycle.
14 For more info on how to design the service in SDC, check this: https://wiki.onap.org/display/DW/CLAMP+videos#CLAMPvideos-DesignpartinSDC
15
16 There is a specific menu to open distributed control loops in CLAMP UI. 
17
18 |clamp-open-menu|
19
20 Please note that the option "Create CL" can be used to create a control loop from the template distributed by SDC, you can therefore instantiate it for another service/vnf 
21
22 Once you click on "Open CL", this dialog box is shown
23
24 |clamp-open-box|
25
26 Once the distributed control loop has been chosen, the control loop is shown to the user.
27 From this view user can start configure empty control loop using **Closed loop modeller**.
28
29 |clamp-opened-closed-loop|
30
31 Closed loop modeler has 3 main parts:
32
33 #. Loop configuration view
34     Visualizes event flow in Control Loop. This view is auto-generated by Clamp. To generate it Clamp parses DCAE_INVENTORY_BLUEPRINT from CSAR distributed by SDC.
35     It Always consists of **VES -> <nodes from blueprint> -> OperationalPolicy**. Not all nodes are visualized. Only those with type **dcae.nodes.\***
36     |blueprint-node|
37
38 #. Loop status
39     Visualizes status of opened loop.
40 #. Loop logs
41     Table with log data of opened loop
42
43 Control Loop properties
44 -----------------------
45 In Dublin release this view shows what are deployment parameters or control Loop.
46 To open it from *Closed Loop* menu select *Properties CL*
47
48 |clamp-menu-prop|
49
50 This opens a box with JSON object. It contains deployment parameters extracted from DCAE_INVENTORY_BLUEPRINT.
51 It's not recommended to edit this JSON. Each of this parameters should be available in view shown to deploy analytic application.
52
53
54 |clamp-prop-box|
55
56 Operational and Guard policy properties
57 ---------------------------------------
58 Operational policy is a parametrized drools (in Dublin) rule with logic performing action on resource.
59 User can't chose his own rule. Clamp always tries to create operational policy that bases on rule bind with **ClosedLoopControlName** attribute available in Policy dictionary.
60
61 There is only one operational policy per control loop. More about operational policies can be found here `Control Loop Operational Policy <https://wiki.onap.org/display/DW/Control+Loop+Operational+Policy>`_.
62
63 Guard policy is policy securing operational policy calls. It defines a set of constraints that have to be matched before running operational policy.
64 More about guard policies can be found here `Creating and Using Guard Policies <https://docs.onap.org/en/dublin/submodules/policy/engine.git/docs/platform/guardpolicy.html>`_.
65
66 To configure operational and guard policy user has to click *OperationalPolicy* box.
67
68 Once clicked, it's possible to configure operational policy. Policy can have child policies, one per Recipe.
69
70 |clamp-op-policy-box-policy1|
71
72 1. Parent policy name
73 2. Global time limit for this operational policies
74 3. Specifies whether policy is abated
75 4. Unique id for Control Loop.
76 5. Button for creating child/parent policies
77     Child/parent policies are policies that depend on one another under certain circumstances (check point 12.)
78 6. Unique id of Policy. (Clamp internal)
79 7. Recipe/Operation triggered on controller/orchestrator
80     This recipe will be used by policy drools PDP when sending request to controller/orchestrator.
81     E.g. in case of *Health-Check* is selected here and *APPC* as actor PDP will trigger APPC LCM API triggering health-check operation.
82
83     List of options is predefined in Clamp code and can't be modified.
84     Possible options:
85         * Restart
86         * Rebuild
87         * Migrate
88         * Health-Check
89         * ModifyConfig
90         * VF Module Create
91         * VF Module Delete
92         * Reroute
93 8. Maximum amount of retries that policy takes when triggering action
94 9. Timeout for this operational policy
95 10. Actor used to perform action. (Orchestrator/Controller)
96      Actor that will be used by drools PDP to perform action.
97      Possible options:
98         * APPC
99         * SO
100         * VFC
101         * SDNC
102         * SDNR
103 11. Payload required by actor to perform an action
104 12. Set of fields describing child/parend policies dependency.
105      E.g. when health-check receives timeout failure restart could be called.
106 13. Set of fields specifying resource. On this resource Operational Policy should perform an action
107 14. Checkbox enabling/disabling guard policy for this operational policy
108 15. Guard Policy type (frequency limited or min max)
109 16. Set of guard policy specific fields. Please check `Creating and Using Guard Policies <https://docs.onap.org/en/dublin/submodules/policy/engine.git/docs/platform/guardpolicy.html>`_.
110
111
112 Micro-service policy properties
113 -------------------------------
114 Boxes between `VES` and `OperationalPolicy` are generated from blueprint. They can be one of ONAP predefined analytic microservices or custom analytics.
115 Each of the boxes is clickable. Microservice configuration view is generated using Policy Type assigned to selected microservice.
116 Clamp by default assumes that microservices have policy type **onap.policies.monitoring.cdap.tca.hi.lo.app**.
117
118 After clicking microservice box Clamp opens popup dialog. Example popup dialog for microservice with default type looks like:
119
120 |clamp-config-policy-tca1|
121
122 |clamp-config-policy-tca2|
123
124
125 Saving Control loop
126 -------------------
127 Policies are saved localy in Clamp after each configuration change
128
129
130 Submitting the Control loop to policy
131 -------------------------------------
132 In the "Manage Menu", the submit action can be used to send the configuration to policy engine.
133
134
135 |clamp-submit-cl|
136
137 If everything is successful, this changes the status to "Submitted". Clamp should also show proper logs in logs view.
138
139 |clamp-distributed|
140
141 After Policies are submitted they should be visible in Policy PAP component.
142 Please check  `Policy GUI <https://docs.onap.org/en/dublin/submodules/policy/engine.git/docs/platform/policygui.html>`_
143
144 Deploy/undeploy the Control Loop to DCAE 
145 -----------------------------------------
146 Once sent to policy engine, Clamp can ask to DCAE to deploy the micro service
147
148 |clamp-deploy|
149
150 This opens a window where the parameters of the DCAE micro service can be configured/tuned.
151 The policy_id is automatically generated by Clamp in the previous steps.
152
153 |clamp-deploy-params|
154
155 Once deployed on DCAE the status Control loop status goes to ACTIVE, it can then be Undeployed/Stopped or even Updated (this is to push new policies on policy engine)
156
157 |clamp-undeploy|
158
159 .. |clamp-open-menu| image:: images/user-guide/open-menu.png
160 .. |clamp-open-box| image:: images/user-guide/open-box.png
161 .. |clamp-opened-closed-loop| image:: images/user-guide/opened-closed-loop.png
162 .. |clamp-menu-prop| image:: images/user-guide/open-menu-prop.png
163 .. |clamp-prop-box| image:: images/user-guide/prop-box.png
164 .. |clamp-op-policy-box-policy1| image:: images/user-guide/op-policy-box-policy1.png
165 .. |clamp-config-policy-tca1| image:: images/user-guide/config-policy-tca1.png
166 .. |clamp-config-policy-tca2| image:: images/user-guide/config-policy-tca2.png
167 .. |clamp-submit-cl| image:: images/user-guide/submit-menu.png
168 .. |clamp-distributed| image:: images/user-guide/distributed.png
169 .. |clamp-deploy| image:: images/user-guide/deploy.png
170 .. |clamp-deploy-params| image:: images/user-guide/deploy-params.png
171 .. |clamp-undeploy| image:: images/user-guide/undeploy.png
172 .. |blueprint-node| image:: images/user-guide/blueprint_node_type.png