Forum Discussion
Marc_64323
Mar 24, 2014Nimbostratus
SOAP File transfers for backup .ucs files result in unreadable files that are bigger than they should be
Greetings! I am trying to automate our backup process for .ucs files remotely. Using bigsuds with the System.ConfigSync.download_configuration() method I am getting strange results, in that not o...
Sparks_86637
Aug 01, 2014Nimbostratus
Hi,
Guessing you've got this working by now, but for anyone else who's interested I got Marc's script to work by simply decoding the file_data as base64. Updated version below is exactly the same except for a few lines....
instantiate connection to bigip
obj = bigsuds.BIGIP(hostname=bigip_ip, username=bigip_user, password=bigip_pwd)
first save config file on bigip device
obj.System.ConfigSync.save_configuration(filename,'SAVE_FULL')
open target file for writing
f = open('/home/bigip_backups/' + filename + '.ucs','wb') <---- This line
download data to file
while write_continue == 1:
temp_config = obj.System.ConfigSync.download_configuration(filename + '.ucs',chunk_size,file_offset)
file_info = temp_config['return']
f.write(base64.b64decode(file_info['file_data'])) <---- And this line
detect EOF
if file_info['chain_type'] == 'FILE_LAST' or file_info['chain_type'] == 'FILE_FIRST_AND_LAST':
write_continue = 0
set offset
file_offset = file_offset + chunk_size
track download progress
print str(file_offset) + " bytes written"
DEBUG
print file_info['chain_type']
cleanup
f.close()
Thanks Marc; your work saved me a lot of time!
Cheers, Stephen
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects