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 6. Unique id of Policy. (Clamp internal)
78 7. Recipe/Operation triggered on controller/orchestrator
79 8. Maximum count of retries
80 9. Timeout for this operational policy
81 10. Actor used to perform action. (Orchestrator/Controller)
82 11. Payload required by actor to perform an action
83 12. Set of fields with policies called under certain conditions. E.g. when health-check receives timeout failure restart could be called.
84 13. Set of fields specifying resource. On this resource Operational Policy should perform an action
85 14. Checkbox enabling/disabling guard policy for this operational policy
86 15. Guard Policy type (frequency limited or min max)
87 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>`_.
88
89
90 Micro-service policy properties
91 -------------------------------
92 Boxes between `VES` and `OperationalPolicy` are generated from blueprint. They can be one of ONAP predefined analytic microservices or custom analytics.
93 Each of the boxes is clickable. Microservice configuration view is generated using Policy Type assigned to selected microservice.
94 Clamp by default assumes that microservices have policy type **onap.policies.monitoring.cdap.tca.hi.lo.app**.
95
96 After clicking microservice box Clamp opens popup dialog. Example popup dialog for microservice with default type looks like:
97
98 |clamp-config-policy-tca1|
99
100 |clamp-config-policy-tca2|
101
102
103 Saving Control loop
104 -------------------
105 Policies are saved localy in Clamp after each configuration change
106
107
108 Submitting the Control loop to policy
109 -------------------------------------
110 In the "Manage Menu", the submit action can be used to send the configuration to policy engine.
111
112
113 |clamp-submit-cl|
114
115 If everything is successful, this changes the status to "Submitted". Clamp should also show proper logs in logs view.
116
117 |clamp-distributed|
118
119 After Policies are submitted they should be visible in Policy PAP component.
120 Please check  `Policy GUI <https://docs.onap.org/en/dublin/submodules/policy/engine.git/docs/platform/policygui.html>`_
121
122 Deploy/undeploy the Control Loop to DCAE 
123 -----------------------------------------
124 Once sent to policy engine, Clamp can ask to DCAE to deploy the micro service
125
126 |clamp-deploy|
127
128 This opens a window where the parameters of the DCAE micro service can be configured/tuned.
129 The policy_id is automatically generated by Clamp in the previous steps.
130
131 |clamp-deploy-params|
132
133 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)
134
135 |clamp-undeploy|
136
137 .. |clamp-open-menu| image:: images/user-guide/open-menu.png
138 .. |clamp-open-box| image:: images/user-guide/open-box.png
139 .. |clamp-opened-closed-loop| image:: images/user-guide/opened-closed-loop.png
140 .. |clamp-menu-prop| image:: images/user-guide/open-menu-prop.png
141 .. |clamp-prop-box| image:: images/user-guide/prop-box.png
142 .. |clamp-op-policy-box-policy1| image:: images/user-guide/op-policy-box-policy1.png
143 .. |clamp-config-policy-tca1| image:: images/user-guide/config-policy-tca1.png
144 .. |clamp-config-policy-tca2| image:: images/user-guide/config-policy-tca2.png
145 .. |clamp-submit-cl| image:: images/user-guide/submit-menu.png
146 .. |clamp-distributed| image:: images/user-guide/distributed.png
147 .. |clamp-deploy| image:: images/user-guide/deploy.png
148 .. |clamp-deploy-params| image:: images/user-guide/deploy-params.png
149 .. |clamp-undeploy| image:: images/user-guide/undeploy.png
150 .. |blueprint-node| image:: images/user-guide/blueprint_node_type.png