blob: 87d5969af84ab4bb94c0cdc9090f4d41d1b0a506 [file] [log] [blame]
Andrea Campanellada354982017-11-16 19:17:08 -08001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Resets a E-CORD Local Pod
4# -----------------------------------------------------------------------------
5
6password=`cat /opt/credentials/xosadmin@opencord.org`
7ip=${1:-localhost}
8fabric_json=${2:-wrong-path}
9cord_json=${3:-wrong-path}
10
11echo Resetting onos_fabric
12cd /opt/onos_fabric
13
14docker-compose down
15
16sleep 5
17
18docker-compose up -d
19
20
21echo Resetting onos_cord
22cd /opt/onos_cord
23
24docker-compose down
25
26sleep 5
27
28docker-compose up -d
29
30sleep 20
31
32echo sending tosca file
33python /opt/cord/build/platform-install/scripts/run_tosca.py 9000 xosadmin@opencord.org ${password} /opt/cord_profile/fabric-service.yaml
34python /opt/cord/build/platform-install/scripts/run_tosca.py 9000 xosadmin@opencord.org ${password} /opt/cord_profile/vtn-service.yaml
35
36sleep 2
37
38python /opt/cord/build/platform-install/scripts/run_tosca.py 9000 xosadmin@opencord.org ${password} /opt/cord_profile/carrierethernet-local-app.yaml
39
40sleep 60
41
42echo sending json config onos_fabric
43
44curl -X POST -H "content-type:application/json" http://${ip}:8181/onos/v1/network/configuration -d @${fabric_json} --user onos:rocks
45
46echo sending json config onos_cord
47
48curl -X POST -H "content-type:application/json" http://${ip}:8182/onos/v1/network/configuration -d @${cord_json} --user onos:rocks
49
50sleep 45
51
52curl -X POST -H "content-type:application/json" http://${ip}:8182/onos/v1/network/configuration -d @${cord_json} --user onos:rocks