4 # ============LICENSE_START=======================================================
6 # ================================================================================
7 # Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
8 # ================================================================================
9 # Licensed under the Apache License, Version 2.0 (the "License");
10 # you may not use this file except in compliance with the License.
11 # You may obtain a copy of the License at
13 # http://www.apache.org/licenses/LICENSE-2.0
15 # Unless required by applicable law or agreed to in writing, software
16 # distributed under the License is distributed on an "AS IS" BASIS,
17 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 # See the License for the specific language governing permissions and
19 # limitations under the License.
20 # ============LICENSE_END=========================================================
23 REST_TOOL="http-prompt"
24 TELEMETRY_SPEC="${POLICY_HOME}/config/telemetry-spec.json"
26 if ! type -p "${REST_TOOL}" > /dev/null 2>&1; then
27 echo "error: prerequisite software not found: http-prompt"
31 if ! "${POLICY_HOME}"/bin/policy-management-controller status > /dev/null 2>&1; then
32 echo "error: pdp-d is not running"
36 if [[ ! -r ${TELEMETRY_SPEC} ]]; then
37 echo "generating new spec .."
38 if ! http -a "${ENGINE_MANAGEMENT_USER}:${ENGINE_MANAGEMENT_PASSWORD}" :9696/swagger.json > ${TELEMETRY_SPEC} 2> /dev/null; then
39 echo "error: cannot generate telemetry spec"
44 exec http-prompt http://localhost:9696/policy/pdp/engine --auth "${ENGINE_MANAGEMENT_USER}:${ENGINE_MANAGEMENT_PASSWORD}" --spec ${TELEMETRY_SPEC}