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