blob: 15c2b15a4e795ef65140d6ae22a872adfb378d53 [file] [log] [blame]
Thomas Vachuskaa7be50d2018-04-16 14:02:18 -07001#!/bin/bash
2
3
4#
5# Copyright 2015-present Open Networking Foundation
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#
19
20# -----------------------------------------------------------------------------
21# Utility for handling common REST API usage.
22# -----------------------------------------------------------------------------
23
24ONOS_WEB_USER=${ONOS_WEB_USER:-onos} # ONOS WEB User defaults to 'onos'
25ONOS_WEB_PASS=${ONOS_WEB_PASS:-rocks} # ONOS WEB Password defaults to 'rocks'
26ONOS_WEB_PORT=${ONOS_WEB_PORT:-8181} # REST API port defaults to '8181'
27
28port=${ONOS_WEB_PORT}
29user=${ONOS_WEB_USER}
30password=${ONOS_WEB_PASS}
31fail="--fail"
32
33while getopts P:u:p:v?h o; do
34 case "$o" in
35 P) port=$OPTARG;;
36 u) user=$OPTARG;;
37 p) password=$OPTARG;;
38 v) fail="";;
39 *) usage;;
40 esac
41done
42
43let OPC=$OPTIND-1
44shift $OPC