Forum Discussion
M_G1
Nimbostratus
Jan 13, 2017Reading External Datagroup files via iControlREST
Is it possible to read/edit the contents of an external datagroup file via iControlREST directly without downloading the file?
https://{{big_ip_a_mgmt}}/mgmt/tm/ltm/data-group/external/my_sampl...
kailas_pathade_
Nimbostratus
Jul 10, 2018dgshow = mgmt.tm.util.bash.exec_cmd('run', utilCmdArgs='-c "cat /config/filestore/files_d/Common_d/data_group_d/{0}"'.format(file_name))
- Muhammad_64435Jul 12, 2018
Nimbostratus
Thank you Kailas ... it worked. Below is my working script to read the contents of all the data groups and display its contents.
dglist = mgmt.tm.util.bash.exec_cmd( 'run', utilCmdArgs='-c "ls /config/filestore/files_d/Common_d/data_group_d"') Write to a file and then read it line by line dgfile = open("dgfilelist", "w") dgfile.write(dglist.commandResult) dgfile.close() dgfile = open("dgfilelist", "r") for file in dgfile: dgshow = mgmt.tm.util.bash.exec_cmd('run', utilCmdArgs='-c "cat /config/filestore/files_d/Common_d/data_group_d/{0} " '.format(file)) print file contents print (dgshow.commandResult) print ("========")
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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