blob: 586b0f0c38a0c8afa5a9f4c1f3e9f8f8c4d51b9a [file] [log] [blame]
Andrea Campanellada354982017-11-16 19:17:08 -08001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Resets the E-CORD Global Pod
4# -----------------------------------------------------------------------------
5
6password=`cat /opt/credentials/xosadmin@opencord.org`
7ip=${1:-localhost}
8cord_json=${2:-wrong-path}
9
10docker exec -i ecordglobal_xos_db_1 psql <<-EOF
11
12\connect xos
13
14DELETE FROM vnaas_eline;
15
Andrea Campanella3a187e92017-11-24 14:37:33 +010016DELETE FROM vnaas_usernetworkinterface;
17
Andrea Campanellada354982017-11-16 19:17:08 -080018EOF
19
20echo Resetting onos_cord
21cd /opt/onos_cord
22
23docker-compose down
24
25sleep 5
26
27docker-compose up -d
28
29sleep 20
30
31echo sending tosca file
32python /opt/cord/build/platform-install/scripts/run_tosca.py 9000 xosadmin@opencord.org ${password} /opt/cord_profile/carrierethernet-global-app.yaml
33
34echo sending json config onos_cord
35
36curl -X POST -H "content-type:application/json" http://${ip}:8182/onos/v1/network/configuration -d @${cord_json} --user onos:rocks