Reply
Highlighted

Backup and restore via WAPI

[ Edited ]
kennethdue
Techie
Posts: 5
220     0

Hello forum

I am having problems finding the answer in wapi-doc

 

how to do a backup and force-overwrite with the restore ... ie a rollback
curl -k1 -u user: pass -X POST 'https://x.x.x.x/wapi/v2.2.2/fileop?_function=getgriddata' -H "Content-Type: application/json" -d '{"type": "BACKUP"}'

and then download file, and send download complete.

i would assume to do a restore one would:
send uploadinit:

curl -k1 -u user: pass -X POST 'https://x.x.x.x/wapi/v2.2.2/fileop?_function=uploadinit'

 

uploading the file:


and then followed by somehow telling infoblox to restore the file ...... ???

by sending 
curl -k1 -u user: pass -X POST 'https://x.x.x.x/wapi/v2.2.2/fileop?_function=setgriddata (or putgriddata, or .....)
with "type": "RESTORE" in the postdata

Re: Backup and restore via WAPI

Adviser
Posts: 56
221     0

Hi,

 

You will need to use the fileop function restoredatabase.

image05.PNG

 

In order to backup you need the following WAPI calls

Initiate a backup:
curl -k -u admin:Infoblox -H 'content-type: application/json' -X POST "https://127.0.0.1/wapi/v2.9/fileop?_function=getgriddata" -d '{"type": "BACKUP"}'

Download the backup:
curl -k -u admin:Infoblox -H 'content-type: application/force-download' "https://127.0.0.1/http_direct_file_io/req_id-DOWNLOAD-1001/database.bak" -o "database.bak"

Remove the stored file using the token
curl -k -u admin:Infoblox -H 'content-type: application/json' -X POST "https://127.0.0.1/wapi/v2.9/fileop?_function=downloadcomplete" -d '{"token" : "eJydUE1PwzAMvfuPjMvaplvWjdtQmYSENmlD4mi1STos2iQkGdr+PQ4SnDhxSOT4fcR+Sjl/w2DO\nwJdyNqZwUckF8ALuFNnB9aO7Fs6afNLNmwhtlzo8mgF8DQqxv9CYyCKCJpXAL+BO+yWcZubqKdww\n0WRm4CXshKxkI+W6XhWyqZayhniaXcLI6Ir5byn5eF+WoqkLpoiiLnMLNfFoCQcaDZIrg/lA0vP2\n8Lp/PmzbuagqUWqeqe+iKfrune2a7EyaqzUb/6VgaJNJWci1qJhXRt68O5syTf7fXwvxY4vGKqfJ\nnnO3Zv+Hp30uF7+EyekcjchptduXLR4fd/ktIaajF6ucpGgYHMiMOmJyqNzku/CtWsM+b9l3Hsn6\nS8JPEyI5m7ENY33xBbQAllA=\n"}'

In order to import and restore the backup, you need the following WAPI calls

Initiate a file upload:
curl -k -u admin:Infoblox -H 'content-type:application/json' -X POST "https://127.0.0.1/wapi/v2.9/fileop?_function=uploadinit"

Upload the contents of the file:
curl -k -u admin:Infoblox -H 'content-type:multipart/form-data' "https://127.0.0.1/ http_direct_file_io/req_id-UPLOAD-1002/import_file" -F file=@databasebak.tar.gz

Upload the backup file:
curl -k -u admin:Infoblox -H 'content-type:application/json' -X POST "https://127.0.0.1/wapi/v2.9/fileop?_function=restoredatabase" -d '{"mode":"FORCED","token":"eJydUE1PwzAMvfuPbJe1Tbe2G7ehMQkJDbTB2WqTdFhqk5CkaPv3OENw4cYhkeP34TxLad0VvT4D\nX9KaEP0ko/XgBMwlmd52g71k1uh04tXpALs2tnjUPbgSJGI30RDJIIIiGcEtYa7cCk4zfXHkrxhp\n1DNwFexFVVRNVddVk4l6tdyUGwin2eQHhmsWvMfowl2ei6bMyjoTWZmnFiriv0XsadBINvf6A0kt\n3l6enre7hSiKMqfRWf/NYK8m2ZLias2uf+kM3CYrDsK1KJiVB07dnnUeR/e/qUL8eKI20ioy59Qt\n2fz+8ZDK5S9htOomSWvabV+3eHzYp3cFIR6dqNMKRcNgT3pQAaNFaUfX+ptqDYcUsGsdknFTxE/t\nA1mTsA1jXfYFNGOU6g==\n"}'

Hope this helps,

Krishna

Showing results for 
Search instead for 
Do you mean 

Recommended for You