Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 
Custom Alert Banner

Backup of Configs in F5

sreebarcl_36723
Nimbostratus
Nimbostratus

I am trying to create a python script using iControl REST to create a backup(ucs file) of the F5 configs and then download the file using tftp to another server.

 

The API endpoint that I am using is /mgmt/tm/sys/ucs. I do a POST with payload as

 

{'command':'save', {'options':[{'ucs':'test1.ucs'}]} . However I am getting a 400 error. Please let me know how to proceed further.

 

3 REPLIES 3

Samir_Jha_52506
Noctilucent
Noctilucent

Try with below commands, hope it will work.

    POST /mgmt/tm/sys { "command":"save", "options":[{"ucs":"lab_backup_july21.ucs"}]}

Below syntax worked perfectly with V11.5

curl -v -sk -u admin:admin https://10.10.1.5/mgmt/tm/sys/ucs -H "Content-Type: application/json" -X POST -d '{"command":"save","name":"test_backup.ucs"}'

curl -sk -u admin:admin https://10.10.1.5/mgmt/tm/sys/ucs/ -H "Content-Type: application/json" -X POST -d '{"command":"save","options":[{"test21_july":""}]}' | python -m json.tool

This creates the backup however I am getting a 500 error as output though!

 

I verified the backup was created by logging into the f5 device and checking it

 

How to overcome this issue because after creating the backup I will have to copy the .ucs file to the local server as well

 

Don't see any issue with Script. Check the if any extra variable has added n creating issue.