Saltstack port not mandatory
[ccsdk/sli/adaptors.git] / saltstack-adapter / saltstack-directed-graphs-sample / reqExecCommand / APPC_saltstack-adapter-1.0-exec-SLSFile.json
1 [
2   {
3     "id": "d0ad0305.352fc",
4     "type": "method",
5     "name": "saltstack-adapter-1.0",
6     "xml": "<method rpc='saltstack-adapter-1.0-exec-SLSFile' mode='sync'>\n",
7     "comments": "",
8     "outputs": 1,
9     "x": 552,
10     "y": 183,
11     "z": "b84dc629.83cd08",
12     "wires": [
13       [
14         "65cc87e2.a95188"
15       ]
16     ]
17   },
18   {
19     "id": "22aefec.e8c7902",
20     "type": "service-logic",
21     "name": "APPC 2.0.1",
22     "module": "APPC",
23     "version": "2.0.1",
24     "comments": "",
25     "xml": "<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='APPC' version='2.0.1'>",
26     "outputs": 1,
27     "x": 343,
28     "y": 261,
29     "z": "b84dc629.83cd08",
30     "wires": [
31       [
32         "d0ad0305.352fc"
33       ]
34     ]
35   },
36   {
37     "id": "31587001.4259e",
38     "type": "returnFailure",
39     "name": "return failure",
40     "xml": "<return status='failure'>\n<parameter name='error-code' value='200' />\n<parameter name='error-message' value='`$org.openecomp.appc.adapter.saltstack.message`' />\n<parameter name='output.status.results' value='`$org.openecomp.appc.adapter.saltstack.results`' />\n",
41     "comments": "",
42     "x": 1262,
43     "y": 365,
44     "z": "b84dc629.83cd08",
45     "wires": []
46   },
47   {
48     "id": "65cc87e2.a95188",
49     "type": "execute",
50     "name": "execute",
51     "xml": "<execute plugin='org.openecomp.appc.adapter.saltstack.SaltstackAdapter' method='reqExecCommand' >\n                        <parameter name='HostName' value='`$AgentUrl`'/>\n                        <parameter name='Port' value='`$Port`'/>\n                        <parameter name='User' value='`$User`'/>\n                        <parameter name='Password' value='`$Password`'/>\n                        <parameter name='Id' value='test1'/>\n                        <parameter name='Cmd' value='salt &apos;*&apos; test.ping --out=json --static'/>\n                        <parameter name='SlsExec' value='false'/>\n                        <parameter name='Timeout' value='`$Timeout`'/>\n",
52     "comments": "",
53     "outputs": 1,
54     "x": 761,
55     "y": 185,
56     "z": "b84dc629.83cd08",
57     "wires": [
58       [
59         "f9bf6ee7.cf954",
60         "7b51c357.a852cc"
61       ]
62     ]
63   },
64   {
65     "id": "42fa1258.aa570c",
66     "type": "switchNode",
67     "name": "switch",
68     "xml": "<switch test=\"`$org.onap.appc.adapter.saltstack.result.code`\">\n",
69     "comments": "",
70     "outputs": 1,
71     "x": 544,
72     "y": 345,
73     "z": "b84dc629.83cd08",
74     "wires": [
75       [
76         "a7cf236a.84c03",
77         "c45d597b.20b4c8"
78       ]
79     ]
80   },
81   {
82     "id": "a7cf236a.84c03",
83     "type": "other",
84     "name": "other",
85     "xml": "<outcome value='Other'>\n",
86     "comments": "",
87     "outputs": 1,
88     "x": 735,
89     "y": 343,
90     "z": "b84dc629.83cd08",
91     "wires": [
92       [
93         "31587001.4259e"
94       ]
95     ]
96   },
97   {
98     "id": "f9bf6ee7.cf954",
99     "type": "failure",
100     "name": "failure",
101     "xml": "<outcome value='failure'>\n",
102     "comments": "",
103     "outputs": 1,
104     "x": 1011,
105     "y": 182,
106     "z": "b84dc629.83cd08",
107     "wires": [
108       [
109         "31587001.4259e"
110       ]
111     ]
112   },
113   {
114     "id": "7b51c357.a852cc",
115     "type": "other",
116     "name": "other",
117     "xml": "<outcome value='Other'>\n",
118     "comments": "",
119     "outputs": 1,
120     "x": 366,
121     "y": 343,
122     "z": "b84dc629.83cd08",
123     "wires": [
124       [
125         "42fa1258.aa570c"
126       ]
127     ]
128   },
129   {
130     "id": "c45d597b.20b4c8",
131     "type": "success",
132     "name": "success",
133     "xml": "<outcome value='200'>\n",
134     "comments": "",
135     "outputs": 1,
136     "x": 351,
137     "y": 459,
138     "z": "b84dc629.83cd08",
139     "wires": [
140       [
141         "30d5f0f7.0e3c8"
142       ]
143     ]
144   },
145   {
146     "id": "2856792.c401a86",
147     "type": "returnSuccess",
148     "name": "return success",
149     "xml": "<return status='success'>\n<parameter name='output.status.code' value='`$org.openecomp.appc.adapter.saltstack.result.code`' />\n<parameter name='output.status.message' value='`$org.openecomp.appc.adapter.saltstack.message`'/>\n<parameter name='output.status.results' value = '`$org.openecomp.appc.adapter.saltstack.results`'/>\n",
150     "comments": "",
151     "x": 1042,
152     "y": 656,
153     "z": "b84dc629.83cd08",
154     "wires": []
155   },
156   {
157     "id": "6c359fdc.3b566",
158     "type": "dgstart",
159     "name": "DGSTART",
160     "outputs": 1,
161     "x": 321,
162     "y": 161,
163     "z": "b84dc629.83cd08",
164     "wires": [
165       [
166         "22aefec.e8c7902"
167       ]
168     ]
169   },
170   {
171     "id": "b5342c59.29f74",
172     "type": "comment",
173     "name": "SaltStack Adaptor DG",
174     "info": "",
175     "comments": "",
176     "x": 693,
177     "y": 44,
178     "z": "b84dc629.83cd08",
179     "wires": []
180   },
181   {
182     "id": "19202194.8ff55e",
183     "type": "comment",
184     "name": "request-method = reqExecCommand, req-action = \"execute multiple SLS commands\"",
185     "info": "Here we basically test if minion1 is active by pinging to it, then install vim package to it. \n",
186     "comments": "",
187     "x": 711,
188     "y": 127,
189     "z": "b84dc629.83cd08",
190     "wires": []
191   },
192   {
193     "id": "a2ebc17e.fa03a",
194     "type": "other",
195     "name": "other",
196     "xml": "<outcome value='Other'>\n",
197     "comments": "",
198     "outputs": 1,
199     "x": 396,
200     "y": 661,
201     "z": "b84dc629.83cd08",
202     "wires": [
203       [
204         "c9345fbb.d6d19"
205       ]
206     ]
207   },
208   {
209     "id": "770411a5.18825",
210     "type": "execute",
211     "name": "execute",
212     "xml": "<execute plugin='org.openecomp.appc.adapter.saltstack.SaltstackAdapter' method='reqExecCommand' >\n                        <parameter name='HostName' value='`$AgentUrl`'/>\n                        <parameter name='Port' value='`$Port`'/>\n                        <parameter name='User' value='`$User`'/>\n                        <parameter name='Password' value='`$Password`'/>\n                        <parameter name='Id' value='test2'/>\n                        <parameter name='Cmd' value='cd /srv/salt/; salt &apos;minion1&apos; state.apply vim --out=json --static'/>\n                        <parameter name='SlsExec' value='true'/>\n                        <parameter name='Timeout' value='`$Timeout`'/>\n",
213     "comments": "",
214     "outputs": 1,
215     "x": 773,
216     "y": 548,
217     "z": "b84dc629.83cd08",
218     "wires": [
219       [
220         "e09a3e12.87428",
221         "a2ebc17e.fa03a"
222       ]
223     ]
224   },
225   {
226     "id": "e09a3e12.87428",
227     "type": "failure",
228     "name": "failure",
229     "xml": "<outcome value='failure'>\n",
230     "comments": "",
231     "outputs": 1,
232     "x": 991,
233     "y": 554,
234     "z": "b84dc629.83cd08",
235     "wires": [
236       [
237         "31587001.4259e"
238       ]
239     ]
240   },
241   {
242     "id": "c9345fbb.d6d19",
243     "type": "switchNode",
244     "name": "switch",
245     "xml": "<switch test=\"`$org.onap.appc.adapter.saltstack.result.code`\">\n",
246     "comments": "",
247     "outputs": 1,
248     "x": 578,
249     "y": 658,
250     "z": "b84dc629.83cd08",
251     "wires": [
252       [
253         "485e453d.36c75c",
254         "f1adcf2a.2c456"
255       ]
256     ]
257   },
258   {
259     "id": "485e453d.36c75c",
260     "type": "other",
261     "name": "other",
262     "xml": "<outcome value='Other'>\n",
263     "comments": "",
264     "outputs": 1,
265     "x": 783,
266     "y": 732,
267     "z": "b84dc629.83cd08",
268     "wires": [
269       [
270         "31587001.4259e"
271       ]
272     ]
273   },
274   {
275     "id": "f1adcf2a.2c456",
276     "type": "success",
277     "name": "success",
278     "xml": "<outcome value='200'>\n",
279     "comments": "",
280     "outputs": 1,
281     "x": 776,
282     "y": 658,
283     "z": "b84dc629.83cd08",
284     "wires": [
285       [
286         "2856792.c401a86"
287       ]
288     ]
289   },
290   {
291     "id": "30d5f0f7.0e3c8",
292     "type": "switchNode",
293     "name": "switch",
294     "xml": "<switch test=\"`$test1.minion1`\">\n",
295     "comments": "",
296     "outputs": 1,
297     "x": 523,
298     "y": 459,
299     "z": "b84dc629.83cd08",
300     "wires": [
301       [
302         "15e9ff68.9812a1",
303         "17d9d7e.4d9a928"
304       ]
305     ]
306   },
307   {
308     "id": "17d9d7e.4d9a928",
309     "type": "other",
310     "name": "outcome",
311     "xml": "<outcome value='true'>\n",
312     "comments": "",
313     "outputs": 1,
314     "x": 593,
315     "y": 550,
316     "z": "b84dc629.83cd08",
317     "wires": [
318       [
319         "770411a5.18825"
320       ]
321     ]
322   },
323   {
324     "id": "15e9ff68.9812a1",
325     "type": "other",
326     "name": "other",
327     "xml": "<outcome value='Other'>\n",
328     "comments": "",
329     "outputs": 1,
330     "x": 717,
331     "y": 459,
332     "z": "b84dc629.83cd08",
333     "wires": [
334       [
335         "31587001.4259e"
336       ]
337     ]
338   },
339   {
340     "id": "b764890c.ed0018",
341     "type": "comment",
342     "name": "Assumptions for this DG (example-server)",
343     "info": "1) Here we assume, the saltstack server is the example-vagrant based server. Where, the master saltstact controlls minion1 and minion2. \n2) We assume that sls file called vim.sls is already present in the path /srv/salt on the server.",
344     "comments": "",
345     "x": 693,
346     "y": 86,
347     "z": "b84dc629.83cd08",
348     "wires": []
349   }
350 ]