Forum Discussion
Steve_Brown_882
Feb 16, 2011Historic F5 Account
pyControl download_file
Has anyone used the config sync download file functionality in python. I have gotten the command to work as follows, but I am not really sure what I need to do to get the resulting data into a file on...
Steve_Brown_882
Feb 26, 2011Historic F5 Account
Hi Matt,
I am just getting around to playing with this again and am hoping you can help me figure out the rest. Basically I figured out the response is chunked so I need to figure out how to put it back together. Here is what I have so far, but it doesn't quite work.
file = open('c:\\file1.ucs', 'w')
ctype = "null"
foffset = 0
while (ctype != "FILE_LAST" ) or (ctype != "FILE_FIRST_AND_LAST"):
ret = b.System.ConfigSync.download_file(file_name = "/var/local/ucs/sat.ucs", chunk_size = 65536, file_offset = foffset)
fdata = getattr(ret,'return').file_data
foffset = getattr(ret, 'file_offset')
foffset = foffset
ctype = getattr(ret,'return').chain_type
unencode = base64.b64decode(fdata)
file.write(unencode)
file.close()
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