Merge "Fix type version in all tosca_service_template"
[policy/parent.git] / docs / clamp / acm / policy-upgrade / policy-upgrade.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2
3 .. _clamp-policy-upgrade-label:
4
5 TOSCA Policy Testing Upgrade
6 ############################
7
8 .. contents::
9     :depth: 4
10
11 1 - Istanbul
12 ============
13
14
15 **Step 1:** Clone Policy Clamp
16
17 .. code-block:: bash
18
19     git clone "https://gerrit.onap.org/r/policy/clamp"
20
21 **Step 2:** Change Master Branch to Istanbul
22
23 .. code-block:: bash
24
25     git checkout -b origin/istanbul
26
27 **Step 3:** Run Maven Clean Install
28
29 .. code-block:: bash
30
31     mvn clean install
32
33 **Step 3:** Create the Database by going to /clamp/runtime/extra/bin-for-dev
34
35 .. code-block:: bash
36
37     ./start-db.sh test
38
39 **Step 4:** Start Clamp Runtime by going to /clamp/runtime/extra/bin-for-dev
40
41 .. code-block:: bash
42
43     ./start-backend.sh
44
45 **Step 5:** Start Control Loop Runtime by going to /clamp/runtime-controlloop
46
47 .. code-block:: bash
48
49     java -jar target/policy-clamp-runtime-controlloop-6.1.5-SNAPSHOT
50
51 **Step 6:** Open up Postman and import the following collections
52
53     `Download <collections/Control Loop Istanbul.postman_collection.json>`_
54
55 **Step 7:** Open up the folder Control Loop Istanbul/Commissioning
56
57     Select POST Commission Tosca Service Template and run it.
58
59     *- Should receive the following result*
60
61 .. code-block:: json
62     :linenos:
63
64     {
65         "errorDetails": null,
66         "affectedInstanceProperties": [
67             {
68                 "name": "PMSH_Instance1",
69                 "version": "1.2.3"
70             },
71             {
72                 "name": "org.onap.domain.pmsh.PMSH_MonitoringPolicyControlLoopElement",
73                 "version": "1.2.3"
74             },
75             {
76                 "name": "org.onap.domain.sample.GenericK8s_ControlLoopDefinition",
77                 "version": "1.2.3"
78             },
79             {
80                 "name": "org.onap.domain.database.PMSH_K8SMicroserviceControlLoopElement_Instance1",
81                 "version": "1.2.3"
82             },
83             {
84                 "name": "org.onap.domain.database.Local_K8SMicroserviceControlLoopElement_Instance1",
85                 "version": "1.2.3"
86             },
87             {
88                 "name": "org.onap.policy.controlloop.PolicyControlLoopParticipant",
89                 "version": "2.3.1"
90             },
91             {
92                 "name": "org.onap.controlloop.HttpControlLoopParticipant",
93                 "version": "2.3.4"
94             },
95             {
96                 "name": "org.onap.domain.database.Http_PMSHMicroserviceControlLoopElement",
97                 "version": "1.2.3"
98             },
99             {
100                 "name": "org.onap.domain.pmsh.PMSH_OperationalPolicyControlLoopElement",
101                 "version": "1.2.3"
102             },
103             {
104                 "name": "org.onap.domain.database.Local_K8SMicroserviceControlLoopElement",
105                 "version": "1.2.3"
106             },
107             {
108                 "name": "org.onap.domain.pmsh.PMSH_MonitoringPolicyControlLoopElement_Instance1",
109                 "version": "1.2.3"
110             },
111             {
112                 "name": "org.onap.domain.pmsh.DerivedPolicyControlLoopElement_Instance1",
113                 "version": "1.2.3"
114             },
115             {
116                 "name": "org.onap.k8s.controlloop.K8SControlLoopParticipant",
117                 "version": "2.3.4"
118             },
119             {
120                 "name": "org.onap.domain.pmsh.DerivedDerivedPolicyControlLoopElement",
121                 "version": "1.2.3"
122             },
123             {
124                 "name": "org.onap.domain.pmsh.PMSH_OperationalPolicyControlLoopElement_Instance1",
125                 "version": "1.2.3"
126             },
127             {
128                 "name": "org.onap.domain.sample.GenericK8s_ControlLoopDefinition_Instance1",
129                 "version": "1.2.3"
130             },
131             {
132                 "name": "org.onap.policy.controlloop.PolicyControlLoopParticipant_Instance1",
133                 "version": "2.3.1"
134             },
135             {
136                 "name": "org.onap.k8s.controlloop.K8SControlLoopParticipant_Instance1",
137                 "version": "2.3.4"
138             },
139             {
140                 "name": "org.onap.controlloop.HttpControlLoopParticipant_Instance1",
141                 "version": "2.3.4"
142             },
143             {
144                 "name": "org.onap.domain.pmsh.DerivedDerivedPolicyControlLoopElement_Instance1",
145                 "version": "1.2.3"
146             },
147             {
148                 "name": "org.onap.domain.database.Http_PMSHMicroserviceControlLoopElement_Instance1",
149                 "version": "1.2.3"
150             },
151             {
152                 "name": "org.onap.domain.database.PMSH_K8SMicroserviceControlLoopElement",
153                 "version": "1.2.3"
154             },
155             {
156                 "name": "org.onap.domain.pmsh.DerivedPolicyControlLoopElement",
157                 "version": "1.2.3"
158             }
159         ]
160     }
161
162 **Step 8:** To try out other endpoints try out the other postman collections inside commission folder
163
164 **Step 9:** To decommission the Tosca Service Template Select DELETE Tosca Service Template
165
166     *- Should receive the following result*
167
168 .. code-block:: json
169     :linenos:
170
171     {
172         "errorDetails": null,
173         "affectedControlLoopDefinitions": [
174             {
175                 "name": "ToscaServiceTemplateSimple",
176                 "version": "1.0.0"
177             }
178         ]
179     }
180
181 **Step 10:** For Instance Properties select the following folder in postman Control Loop Istanbul/Instantiation
182
183     Select POST Instance Properties
184
185     *- Should receive the following result*
186
187 .. code-block:: json
188     :linenos:
189
190     {
191         "errorDetails": null,
192         "affectedInstanceProperties": [
193             {
194                 "name": "PMSH_Instance1",
195                 "version": "1.2.3"
196             },
197             {
198                 "name": "org.onap.domain.pmsh.PMSH_MonitoringPolicyControlLoopElement",
199                 "version": "1.2.3"
200             },
201             {
202                 "name": "org.onap.domain.sample.GenericK8s_ControlLoopDefinition",
203                 "version": "1.2.3"
204             },
205             {
206                 "name": "org.onap.domain.database.PMSH_K8SMicroserviceControlLoopElement_Instance1",
207                 "version": "1.2.3"
208             },
209             {
210                 "name": "org.onap.domain.database.Local_K8SMicroserviceControlLoopElement_Instance1",
211                 "version": "1.2.3"
212             },
213             {
214                 "name": "org.onap.policy.controlloop.PolicyControlLoopParticipant",
215                 "version": "2.3.1"
216             },
217             {
218                 "name": "org.onap.controlloop.HttpControlLoopParticipant",
219                 "version": "2.3.4"
220             },
221             {
222                 "name": "org.onap.domain.database.Http_PMSHMicroserviceControlLoopElement",
223                 "version": "1.2.3"
224             },
225             {
226                 "name": "org.onap.domain.pmsh.PMSH_OperationalPolicyControlLoopElement",
227                 "version": "1.2.3"
228             },
229             {
230                 "name": "org.onap.domain.database.Local_K8SMicroserviceControlLoopElement",
231                 "version": "1.2.3"
232             },
233             {
234                 "name": "org.onap.domain.pmsh.PMSH_MonitoringPolicyControlLoopElement_Instance1",
235                 "version": "1.2.3"
236             },
237             {
238                 "name": "org.onap.domain.pmsh.DerivedPolicyControlLoopElement_Instance1",
239                 "version": "1.2.3"
240             },
241             {
242                 "name": "org.onap.k8s.controlloop.K8SControlLoopParticipant",
243                 "version": "2.3.4"
244             },
245             {
246                 "name": "org.onap.domain.pmsh.DerivedDerivedPolicyControlLoopElement",
247                 "version": "1.2.3"
248             },
249             {
250                 "name": "org.onap.domain.pmsh.PMSH_OperationalPolicyControlLoopElement_Instance1",
251                 "version": "1.2.3"
252             },
253             {
254                 "name": "org.onap.domain.sample.GenericK8s_ControlLoopDefinition_Instance1",
255                 "version": "1.2.3"
256             },
257             {
258                 "name": "org.onap.policy.controlloop.PolicyControlLoopParticipant_Instance1",
259                 "version": "2.3.1"
260             },
261             {
262                 "name": "org.onap.k8s.controlloop.K8SControlLoopParticipant_Instance1",
263                 "version": "2.3.4"
264             },
265             {
266                 "name": "org.onap.controlloop.HttpControlLoopParticipant_Instance1",
267                 "version": "2.3.4"
268             },
269             {
270                 "name": "org.onap.domain.pmsh.DerivedDerivedPolicyControlLoopElement_Instance1",
271                 "version": "1.2.3"
272             },
273             {
274                 "name": "org.onap.domain.database.Http_PMSHMicroserviceControlLoopElement_Instance1",
275                 "version": "1.2.3"
276             },
277             {
278                 "name": "org.onap.domain.database.PMSH_K8SMicroserviceControlLoopElement",
279                 "version": "1.2.3"
280             },
281             {
282                 "name": "org.onap.domain.pmsh.DerivedPolicyControlLoopElement",
283                 "version": "1.2.3"
284             }
285         ]
286     }
287
288 **Step 11:** To try out other endpoints try out the other postman collections inside Instantiation folder
289
290 **Step 12:** To delete Instance properties select DELETE Instance Properties
291
292     *- Should receive the following result*
293
294 .. code-block:: json
295     :linenos:
296
297     {
298         "errorDetails": null,
299         "affectedControlLoops": [
300             {
301                 "name": "PMSH_Instance1",
302                 "version": "1.2.3"
303             }
304         ]
305     }
306
307 **Step 13:** For monitoring endpoints go to Control Loop Istanbul/Monitoring folder
308
309 2 - Jakarta
310 ===========
311
312
313 **Step 1:** Clone Policy Clamp
314
315 .. code-block:: bash
316
317     git clone "https://gerrit.onap.org/r/policy/clamp"
318
319 **Step 2:** Change Master Branch to Jakarta
320
321 .. code-block:: bash
322
323     git checkout -b origin/jakarta
324
325 **Step 3:** Run Maven Clean Install
326
327 .. code-block:: bash
328
329     mvn clean install
330
331 **Step 3:** Create the Database by going to /clamp/runtime/extra/bin-for-dev
332
333 .. code-block:: bash
334
335     ./start-db.sh test
336
337 **Step 4:** Start Clamp Runtime by going to /clamp/runtime/extra/bin-for-dev
338
339 .. code-block:: bash
340
341     ./start-backend.sh
342
343 **Step 5:** Start Automation Composition Runtime by going to /clamp/runtime-acm
344
345 .. code-block:: bash
346
347     java -jar target/policy-clamp-runtime-acm-6.3.0-SNAPSHOT.jar
348
349 **Step 6:** Open up Postman and import the following collections
350
351     `Download <collections/Automation Composition Jakarta.postman_collection.json>`_
352
353 **Step 7:** Open up the folder Automation Composition Jakarta/Commissioning
354
355     Select POST Commission Tosca Service Template and run it.
356
357     *- Should receive the following result*
358
359 .. code-block:: json
360     :linenos:
361
362     {
363         "errorDetails": null,
364         "affectedAutomationCompositionDefinitions": [
365             {
366                 "name": "org.onap.domain.database.Http_PMSHMicroserviceAutomationCompositionElement",
367                 "version": "1.2.3"
368             },
369             {
370                 "name": "org.onap.domain.database.PMSH_K8SMicroserviceAutomationCompositionElement",
371                 "version": "1.2.3"
372             },
373             {
374                 "name": "org.onap.domain.pmsh.PMSH_MonitoringPolicyAutomationCompositionElement",
375                 "version": "1.2.3"
376             },
377             {
378                 "name": "org.onap.domain.pmsh.PMSH_OperationalPolicyAutomationCompositionElement",
379                 "version": "1.2.3"
380             },
381             {
382                 "name": "org.onap.domain.sample.GenericK8s_AutomationCompositionDefinition",
383                 "version": "1.2.3"
384             },
385             {
386                 "name": "org.onap.policy.clamp.acm.HttpParticipant",
387                 "version": "2.3.4"
388             },
389             {
390                 "name": "org.onap.policy.clamp.acm.KubernetesParticipant",
391                 "version": "2.3.4"
392             },
393             {
394                 "name": "org.onap.policy.clamp.acm.PolicyParticipant",
395                 "version": "2.3.1"
396             }
397         ]
398     }
399
400 **Step 8:** To try out other endpoints try out the other postman collections inside commission folder
401
402 **Step 9:** To decommission the Tosca Service Template Select DELETE Tosca Service Template
403
404     *- Should receive the following result*
405
406 .. code-block:: json
407     :linenos:
408
409     {
410         "errorDetails": null,
411         "affectedAutomationCompositionDefinitions": [
412             {
413                 "name": "ToscaServiceTemplateSimple",
414                 "version": "1.0.0"
415             }
416         ]
417     }
418
419 **Step 10:** For Instance Properties select the following folder in postman Automation Composition Jakarta/Instantiation
420
421     Select POST Instance Properties
422
423     *- Should receive the following result*
424
425 .. code-block:: json
426     :linenos:
427
428     {
429         "errorDetails": null,
430         "affectedInstanceProperties": [
431             {
432                 "name": "ATT",
433                 "version": "2.3.4"
434             },
435             {
436                 "name": "org.onap.domain.sample.GenericK8s_AutomationCompositionDefinition",
437                 "version": "1.2.3"
438             },
439             {
440                 "name": "org.onap.policy.clamp.acm.PolicyParticipant",
441                 "version": "2.3.1"
442             },
443             {
444                 "name": "org.onap.domain.pmsh.PMSH_OperationalPolicyAutomationCompositionElement",
445                 "version": "1.2.3"
446             },
447             {
448                 "name": "org.onap.domain.pmsh.PMSH_MonitoringPolicyAutomationCompositionElement",
449                 "version": "1.2.3"
450             },
451             {
452                 "name": "org.onap.policy.clamp.acm.HttpParticipant",
453                 "version": "2.3.4"
454             },
455             {
456                 "name": "org.onap.policy.clamp.acm.KubernetesParticipant-ATT",
457                 "version": "2.3.4"
458             },
459             {
460                 "name": "org.onap.policy.clamp.acm.KubernetesParticipant",
461                 "version": "2.3.4"
462             },
463             {
464                 "name": "org.onap.domain.database.Http_PMSHMicroserviceAutomationCompositionElement-ATT",
465                 "version": "1.2.3"
466             },
467             {
468                 "name": "org.onap.domain.pmsh.PMSH_OperationalPolicyAutomationCompositionElement-ATT",
469                 "version": "1.2.3"
470             },
471             {
472                 "name": "org.onap.domain.database.Http_PMSHMicroserviceAutomationCompositionElement",
473                 "version": "1.2.3"
474             },
475             {
476                 "name": "org.onap.domain.database.PMSH_K8SMicroserviceAutomationCompositionElement-ATT",
477                 "version": "1.2.3"
478             },
479             {
480                 "name": "org.onap.domain.pmsh.PMSH_MonitoringPolicyAutomationCompositionElement-ATT",
481                 "version": "1.2.3"
482             },
483             {
484                 "name": "org.onap.policy.clamp.acm.PolicyParticipant-ATT",
485                 "version": "2.3.1"
486             },
487             {
488                 "name": "org.onap.policy.clamp.acm.HttpParticipant-ATT",
489                 "version": "2.3.4"
490             },
491             {
492                 "name": "org.onap.domain.database.PMSH_K8SMicroserviceAutomationCompositionElement",
493                 "version": "1.2.3"
494             },
495             {
496                 "name": "org.onap.domain.sample.GenericK8s_AutomationCompositionDefinition-ATT",
497                 "version": "1.2.3"
498             }
499         ]
500     }
501
502 **Step 11:** To try out other endpoints try out the other postman collections inside Instantiation folder
503
504 **Step 12:** To delete Instance properties select DELETE Instance Properties
505
506     *- Should receive the following result*
507
508 .. code-block:: json
509     :linenos:
510
511     {
512         "errorDetails": null,
513         "affectedAutomationCompositionDefinitions": [
514             {
515                 "name": "ToscaServiceTemplateSimple",
516                 "version": "1.0.0"
517             }
518         ]
519     }
520
521 **Step 13:** For monitoring endpoints go to Automation Composition Jakarta/Monitoring folder
522