X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=heat%2FvFW_CNF_CDS%2Ftemplates%2Fpolicy%2Fpolicy.sh;fp=heat%2FvFW_CNF_CDS%2Ftemplates%2Fpolicy%2Fpolicy.sh;h=0000000000000000000000000000000000000000;hb=1389192a547b108a5492460e6e1bad672935f3bc;hp=a09ab0a8c90d200474bfc445671d31b21bfec6b2;hpb=7c523c94d26afe32ef655e252cf06583aa3509ec;p=demo.git diff --git a/heat/vFW_CNF_CDS/templates/policy/policy.sh b/heat/vFW_CNF_CDS/templates/policy/policy.sh deleted file mode 100755 index a09ab0a8..00000000 --- a/heat/vFW_CNF_CDS/templates/policy/policy.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash - -set -e - -check(){ - if ! which curl >/dev/null 2>&1; then - echo "Fatal error, curl command not available" >&2 - return 1 - fi - - for arg; do - if ! test -f "$arg"; then - echo "Fatal error, REST payload - $arg - not found in current directory" >&2 - return 1 - fi - done -} - -query_policy(){ - local mode="$1" - local content="$2" - local url="$3" - - declare -a flags=(-kf -H 'Content-Type: application/json' - -H 'ClientAuth: cHl0aG9uOnRlc3Q=' -u testpdp:alpha123 - -H 'Environment: TEST') - - check "$content" - - curl -X "$mode" -d @"$content" "${flags[@]}" "${PDP_URL:-https://pdp:8081}/$url" -} - -case "$1" in - -h|--help|help|?|"") - echo "Script usage:" - echo "$0 get|verify - query policy for CNF policy" - echo "$0 create - Create CNF naming policy and push it" - echo "$0 update - Update CNF naming policy and push it" - ;; - get|verify) - query_policy POST get.json pdp/api/getConfig - ;; - create|update) - query_policy PUT create.json "pdp/api/$1Policy" - query_policy PUT push.json "pdp/api/pushPolicy" - ;; - *) - echo "Wrong usage, check '$0 -h'" >&2 - exit 1 - ;; -esac