blob: 64f291586c7fc4c1bf7a41b2ff8b44699c2ddc33 [file] [log] [blame]
Henry.Suna87af3f2020-04-28 15:52:20 +08001.. This work is licensed under a Creative Commons Attribution
2.. 4.0 International License.
3.. http://creativecommons.org/licenses/by/4.0
4
5Using Monitoring Gui
6--------------------
7
8 .. container:: paragraph
9
10 Here is an example running Monitoring Gui on a Native Windows Computer.
11
12Environment setup
13#################
14
15 .. container:: paragraph
16
17 create and run docker images about the following tar packages
18
19 .. container:: listingblock
20
21 .. container:: content
22
23 .. code::
24 :number-lines:
25
26 docker load-i pdp.tar
27 docker load-i mariadb.tar
28 docker load-i api.tar
29 docker load-i apex.tar
30 docker load-i pap.tar
31 docker load-i xacml.tar
32
33 .. container:: paragraph
34
35 download latest source from gerrit and create tar by command
36
37 .. code::
38 :number-lines:
39
40 tar example example.tar
41
42 .. container:: paragraph
43
44 download drools-pdp latest source from gerrit
45
46 .. container:: paragraph
47
48 prepare eclipse for starting drools-pdp
49
50 .. container:: paragraph
51
52 config drools-pdp dependency in eclipse
53
54 .. container:: ulist
55
56 - create config folder inside drools-pdp\policy-management, copy feature-lifecycle.properties into this folder
57
58 .. container:: imageblock
59
60 .. container:: content
61
62 |Create the Folder Arc|
63
64 .. container:: content
65
66 .. code::
67 :number-lines:
68
69 lifecycle.pdp.group=${envd:POLICY_PDP_PAP_GROUP:defaultGroup}
70
71 dmaap.source.topics=POLICY-PDP-PAP
72 dmaap.sink.topics=POLICY-PDP-PAP
73
74 dmaap.source.topics.POLICY-PDP-PAP.servers=localhost:3904
75 dmaap.source.topics.POLICY-PDP-PAP.managed=false
76
77 dmaap.sink.topics.POLICY-PDP-PAP.servers=localhost:3904
78 dmaap.sink.topics.POLICY-PDP-PAP.managed=false
79
80 - update run property "classpath" of "drools.system.Main" in Eclipse
81
82 .. container:: imageblock
83
84 .. container:: content
85
86 |Update run Property|
87
88 .. container:: imageblock
89
90 .. container:: content
91
92 |Lifecycle classpath setting|
93
94Prepare Postman for sending REST request to components during demo
95##################################################################
96
97 .. container:: paragraph
98
99 import "demo.postman_collection.json" into PostMan
100
101 .. container:: imageblock
102
103 .. container:: content
104
105 |Import JSON in PostMan|
106
107 .. container:: content
108
109 "demo.postman_collection.json", ":download:`link <demo.postman_collection.json>`"
110
111 .. container:: paragraph
112
113 clean docker environment
114
115 .. code::
116 :number-lines:
117
118 # docker rm $(docker ps-aq)
119
120Demo steps
121##########
122 .. container:: paragraph
123
124 docker compose start mariadb and message-router. Mariadb must be started in a seperate console because it needs several seconds to finish startup, and other docker startups depends on this
125
126 .. container::
127
128 .. container:: content
129
130 .. code::
131 :number-lines:
132
133 # docker-compose up -d mariadb message-router
134
135 .. container:: paragraph
136
137 docker compose start other components API, PAP, APEX-PDP, XACML-PDP
138
139 .. container::
140
141 .. container:: content
142
143 .. code::
144 :number-lines:
145
146 # docker-compose up -d pdp xacml pap api
147
148 .. container:: paragraph
149
150 start "drools.system.Main" in eclipse
151
152 .. container:: paragraph
153
154 verify PDPs are registered into the database
155
156 .. container:: ulist
157
158 - get pdp lists in database
159
160 .. container:: paragraph
161
162 curl --location --request GET 'http://localhost:7979/policy/pap/v1/pdps' --user 'healthcheck:zb!XztG34' | json_pp
163
164 - get statistics
165
166 .. container:: paragraph
167
168 curl --location --request GET 'http://localhost:7979/policy/pap/v1/pdps/statistics/' --user 'healthcheck:zb!XztG34' | json_pp
169
170 .. container:: ulist
171
172 - start PAP statistics monitoring GUI
173
174 .. container:: paragraph
175
176 java -jar client/client-monitoring/target/client-monitoring-uber 2.2.0-SNAPSHOT.jar
177
178 - open monitor in browser
179
180 .. container:: paragraph
181
182 curl localhost:18999
183
184 .. container:: paragraph
185
186 set up pap parameter
187
188 .. container:: imageblock
189
190 .. container:: content
191
192 |Pap parameter|
193
194 .. container:: paragraph
195
196 input parameters
197
198 .. container:: imageblock
199
200 .. container:: content
201
202 |Set up pap parameter|
203
204 .. container:: paragraph
205
206 Fetch PdpLists
207
208 .. container:: imageblock
209
210 .. container:: content
211
212 |Fetch Pdp Lists|
213
214 .. container:: paragraph
215
216 no Engine Worker started, we can only see healthcheck result when we click on the instance APEX statistics
217
218 .. container:: imageblock
219
220 |No engine worker started|
221
222 .. container:: paragraph
223
224 XACML statistics
225
226 .. container:: imageblock
227
228 |XACML statistics|
229
230 .. container:: paragraph
231
232 use PostMan to send request to API to create policy type/create policy/ deploy policy
233
234 .. container:: content
235
236 .. code::
237 :number-lines:
238
239 API_Create Policy Type
240 API_Create Policy
241 Simple Deploy Policy
242
243 .. container:: paragraph
244
245 now APEX PDP statistics data includes engine worker statistics, and shows the monitoring GUI updating automatically (every 2 minutes)
246
247 .. container:: imageblock
248
249 |Engine worker started|
250
251 .. container:: paragraph
252
253 use PostMan to send a request to DMAAP, add one xacml-pdp statistics message manually, show that the monitoring GUI updates the PostMan API
254
255 .. container::
256
257 .. container ::content
258
259 .. code::
260 :number-lines:
261 Update Xacml Stats
262
263 .. container:: paragraph
264
265 xacml-pdp statistics update
266
267 .. container:: imageblock
268
269 |Update XACML statistics|
270
271
272
273
274.. |Create the Folder Arc| image:: ./images/CreateFolder.png
275.. |Update run Property| image:: ./images/ClassPathRunProperty.png
276.. |Lifecycle classpath setting| image:: ./images/ClassPathSetting.png
277.. |Import JSON in PostMan| image:: ./images/ImportPostmanJson.png
278.. |Pap parameter| image:: ./images/PapParameter.png
279.. |Set up pap parameter| image:: ./images/PapInputParameter.png
280.. |Fetch Pdp Lists| image:: ./images/FetchPdpLists.png
281.. |No engine worker started| image:: ./images/NoEngineWorker.png
282.. |XACML statistics| image:: ./images/XACMLstatistics.png
283.. |Engine worker started| image:: ./images/PDPstatistics.png
284.. |Update XACML statistics| image:: ./images/UpdateStatistics.png