Pamela Dragosh | 0e16acf | 2017-02-14 19:45:48 -0500 | [diff] [blame] | 1 | #! /bin/bash |
| 2 | |
Pamela Dragosh | 0e16acf | 2017-02-14 19:45:48 -0500 | [diff] [blame] | 3 | # ============LICENSE_START======================================================= |
jhh | 3f563fe | 2020-03-05 22:32:58 -0600 | [diff] [blame] | 4 | # ONAP |
Pamela Dragosh | 0e16acf | 2017-02-14 19:45:48 -0500 | [diff] [blame] | 5 | # ================================================================================ |
jhh | 3f563fe | 2020-03-05 22:32:58 -0600 | [diff] [blame] | 6 | # Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. |
Pamela Dragosh | 0e16acf | 2017-02-14 19:45:48 -0500 | [diff] [blame] | 7 | # ================================================================================ |
| 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 |
jhh | 3f563fe | 2020-03-05 22:32:58 -0600 | [diff] [blame] | 11 | # |
Pamela Dragosh | 0e16acf | 2017-02-14 19:45:48 -0500 | [diff] [blame] | 12 | # http://www.apache.org/licenses/LICENSE-2.0 |
jhh | 3f563fe | 2020-03-05 22:32:58 -0600 | [diff] [blame] | 13 | # |
Pamela Dragosh | 0e16acf | 2017-02-14 19:45:48 -0500 | [diff] [blame] | 14 | # 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 Dragosh | 0e16acf | 2017-02-14 19:45:48 -0500 | [diff] [blame] | 20 | |
| 21 | source $POLICY_HOME/etc/profile.d/env.sh |
| 22 | |
| 23 | if [[ -n $1 ]]; then |
jhh | 3f563fe | 2020-03-05 22:32:58 -0600 | [diff] [blame] | 24 | 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 Dragosh | 0e16acf | 2017-02-14 19:45:48 -0500 | [diff] [blame] | 33 | fi |
| 34 | |
Pamela Dragosh | 0e16acf | 2017-02-14 19:45:48 -0500 | [diff] [blame] | 35 | cat <<-'EOF' |
| 36 | |
| 37 | Usage: rest-delete-controller.sh closed-loop-sample|reporter|sepc|vsegw|.. (or any other controller idenfied by name) |
| 38 | |
| 39 | EOF |