-
Notifications
You must be signed in to change notification settings - Fork 15
/
listenForEvents.sh
executable file
·57 lines (45 loc) · 2 KB
/
listenForEvents.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
# Copyright (c) 2018, Arm Limited and affiliates.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
EXECPATH="$1"
ARG1="$EXECPATH"
ARG2="$2"
ARG3="$3"
ARG4="$4"
ARG5="$5"
ARG6="$6"
ARG7="$7"
PAYLOAD="{\"path\":\"${EXECPATH}\",\"arguments\":[\"$ARG1\",\"$ARG2\",\"$ARG3\",\"$ARG4\",\"$ARG5\",\"$ARG6\",\"$ARG7\"],\"inheritEnv\":true}"
#\"Daemonize\":true}"
echo curl -i \
--unix-socket /tmp/maestroapi.sock http://localhost/events \
-H "Host: 127.0.0.1" \
-H "Accept: application/json" \
-X POST -d $PAYLOAD
# -X POST -d '{"Path":"${EXECPATH}","Arguments":["$ARG1","$ARG2","$ARG3","$ARG4","$ARG5","$ARG6","$ARG7"]}'
curl -i \
--unix-socket /tmp/maestroapi.sock http://localhost/events \
-H "Host: 127.0.0.1" \
-H "Accept: application/json" \
-X GET
# -X POST -d '{"Path":"${EXECPATH}","Arguments":["$ARG1","$ARG2","$ARG3","$ARG4","$ARG5","$ARG6","$ARG7"]}'
# -H "Accept: application/json" \
# -H "X-HTTP-Method-Override: PUT" \
# -X POST -d "Path":"$PATH","Arguments":"Tip 3","targetModule":"Target 3","configurationGroup":null,"name":"Configuration Deneme 3","description":null,"identity":"Configuration Deneme 3","version":0,"systemId":3,"active":true
# Notes:
# the http unix-socket is requires root normally, for security reasons
# you will need curl 7.40 or later, and libcurl 7.40 or later.
# if you install the newer one on Ubuntu 14.04, use the LD_PRELOAD trick like such
# sudo LD_PRELOAD="/usr/lib/libcurl.so.4.4.0" ./startProcessTest.sh