From b91390ec0ace31ec02df5bb9aeb7b9e94fab507f Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Thu, 31 May 2018 21:01:17 -0400 Subject: Add backup/restore scripts Add scripts to invoke daexim REST API to backup and restore MD-SAL data Change-Id: Ic25b1a24722bcec6f40524f9fd2abd6ac6c9b3d9 Issue-ID: SDNC-223 Signed-off-by: Timoney, Dan (dt5972) Former-commit-id: e61c0b2b8015e3bbf75c19e0d3f24192c52c89b3 --- installation/sdnc/src/main/scripts/backupMdsal.sh | 12 ++++++++++++ installation/sdnc/src/main/scripts/restoreMdsal.sh | 11 +++++++++++ 2 files changed, 23 insertions(+) create mode 100644 installation/sdnc/src/main/scripts/backupMdsal.sh create mode 100644 installation/sdnc/src/main/scripts/restoreMdsal.sh (limited to 'installation') diff --git a/installation/sdnc/src/main/scripts/backupMdsal.sh b/installation/sdnc/src/main/scripts/backupMdsal.sh new file mode 100644 index 00000000..3aefec28 --- /dev/null +++ b/installation/sdnc/src/main/scripts/backupMdsal.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +cat > /tmp/daexim-export.json <<-END +{ + "input": { + "data-export-import:run-at": 5 + } +} +END + +curl -v -H "Content-Type: application/json" -X POST -uadmin:Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U -d@/tmp/daexim-export.json http://localhost:8282/restconf/operations/data-export-import:schedule-export + diff --git a/installation/sdnc/src/main/scripts/restoreMdsal.sh b/installation/sdnc/src/main/scripts/restoreMdsal.sh new file mode 100644 index 00000000..1f73d776 --- /dev/null +++ b/installation/sdnc/src/main/scripts/restoreMdsal.sh @@ -0,0 +1,11 @@ +#!/bin/bash +cat > /tmp/daexim-import.json <<-END +{ + "input" : { + "check-models" : true, + "clear-stores" : "all" + } +} +END + +curl -v -H "Content-Type: application/json" -X POST -uadmin:Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U -d@/tmp/daexim-import.json http://localhost:8080/restconf/operations/data-export-import:immediate-import -- cgit 1.2.3-korg