blob: c2741191760944a8a6b3a0dc80be6b8d03b565f4 [file] [log] [blame]
Pamela Dragosh0e16acf2017-02-14 19:45:48 -05001#! /bin/bash
2
Pamela Dragosh0e16acf2017-02-14 19:45:48 -05003# ============LICENSE_START=======================================================
jhh3f563fe2020-03-05 22:32:58 -06004# ONAP
Pamela Dragosh0e16acf2017-02-14 19:45:48 -05005# ================================================================================
jhh3f563fe2020-03-05 22:32:58 -06006# Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
Pamela Dragosh0e16acf2017-02-14 19:45:48 -05007# ================================================================================
8# Licensed under the Apache License, Version 2.0 (the "License");
9# you may not use this file except in compliance with the License.
10# You may obtain a copy of the License at
jhh3f563fe2020-03-05 22:32:58 -060011#
Pamela Dragosh0e16acf2017-02-14 19:45:48 -050012# http://www.apache.org/licenses/LICENSE-2.0
jhh3f563fe2020-03-05 22:32:58 -060013#
Pamela Dragosh0e16acf2017-02-14 19:45:48 -050014# Unless required by applicable law or agreed to in writing, software
15# distributed under the License is distributed on an "AS IS" BASIS,
16# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17# See the License for the specific language governing permissions and
18# limitations under the License.
19# ============LICENSE_END=========================================================
Pamela Dragosh0e16acf2017-02-14 19:45:48 -050020
21source $POLICY_HOME/etc/profile.d/env.sh
22
23if [[ -n $1 ]]; then
jhh3f563fe2020-03-05 22:32:58 -060024 if [[ -n ${TELEMETRY_PASSWORD} ]]; then
25 curl -k --silent --user ${TELEMETRY_USER}:${TELEMETRY_PASSWORD} -X DELETE --header "Content-Type: application/json" \
26 https://localhost:${TELEMETRY_PORT}/policy/pdp/engine/controllers/${1}
27 else
28 curl -k --silent -X DELETE --header "Content-Type: application/json" \
29 https://localhost:${TELEMETRY_PORT}/policy/pdp/engine/controllers/${1}
30 fi
31 echo
32 exit
Pamela Dragosh0e16acf2017-02-14 19:45:48 -050033fi
34
Pamela Dragosh0e16acf2017-02-14 19:45:48 -050035cat <<-'EOF'
36
37Usage: rest-delete-controller.sh closed-loop-sample|reporter|sepc|vsegw|.. (or any other controller idenfied by name)
38
39EOF