6 if ! which curl >/dev/null 2>&1; then
7 echo "Fatal error, curl command not available" >&2
12 if ! test -f "$arg"; then
13 echo "Fatal error, REST payload - $arg - not found in current directory" >&2
24 declare -a flags=(-kf -H 'Content-Type: application/json'
25 -H 'ClientAuth: cHl0aG9uOnRlc3Q=' -u testpdp:alpha123
26 -H 'Environment: TEST')
30 curl -X "$mode" -d @"$content" "${flags[@]}" "${PDP_URL:-https://pdp:8081}/$url"
36 echo "$0 get|verify - query policy for CNF policy"
37 echo "$0 create - Create CNF naming policy and push it"
38 echo "$0 update - Update CNF naming policy and push it"
41 query_policy POST get.json pdp/api/getConfig
44 query_policy PUT create.json "pdp/api/$1Policy"
45 query_policy PUT push.json "pdp/api/pushPolicy"
48 echo "Wrong usage, check '$0 -h'" >&2