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