blob: e5b7b056a75a2d581b86f76d7266b3835c1f36c6 [file] [log] [blame]
Filip Krzywkaccdbec82018-12-12 08:14:57 +01001#!/usr/bin/env bash
2# ============LICENSE_START=======================================================
3# dcaegen2-collectors-veshv
4# ================================================================================
5# Copyright (C) 2018 NOKIA
6# ================================================================================
7# Licensed under the Apache License, Version 2.0 (the "License");
8# you may not use this file except in compliance with the License.
9# You may obtain a copy of the License at
10#
11# http://www.apache.org/licenses/LICENSE-2.0
12#
13# Unless required by applicable law or agreed to in writing, software
14# distributed under the License is distributed on an "AS IS" BASIS,
15# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16# See the License for the specific language governing permissions and
17# limitations under the License.
18# ============LICENSE_END=========================================================
19
20set -euo pipefail
21
22
23usage() {
24 echo "Resets dcae-app-simulator consumed messages count"
25 echo "Usage: $0 [-h|--help] [-v|--verbose]"
26 exit 1
27}
28
29optspec=":vh-:" # catch v, h and -
30while getopts "$optspec" arg; do
31 case "${arg}" in
32 -) # handle longopts
33 case "${OPTARG}" in
34 verbose)
35 VERBOSE=True
36 ;;
37 help)
38 usage
39 ;;
40 *)
41 echo "Unknown option --${OPTARG}" >&2
42 usage
43 ;;
44 esac
45 ;;
46 v)
47 VERBOSE=True
48 ;;
49 h)
50 usage
51 ;;
52 *)
53 echo "Unknown option -${OPTARG}" >&2
54 usage
55 ;;
56 esac
57done
58shift $((OPTIND-1))
59
60if [ -n "${VERBOSE+x}" ]; then
61 echo "Requesting DCAE app running on port 6063 to reset messages count"
62fi
63
64curl --request DELETE localhost:6063/messages
65echo