Forum Discussion
Bill_Homan
Nimbostratus
Apr 24, 2020Use F5 REST API Python SDK to update an external datagroup
I have working code using the F5 Python REST SDK that can upload a txt file and create an external datagroup from it. But I cannot figure out how to use the API to update that datagroup file with...
Mar 02, 2007
The CR was applied to 9.4.0, not 9.2.4. I've just checked the CR's state and it's set to Verified Fixed for 9.4.0 build 297.0.
-Joe
- Bill_HomanMay 02, 2020
Nimbostratus
Thanks Satoshi! I was able to employ patch as you suggested using this Python code:
def update_edg_file(rq, url, fileserver, newfilename, dgfname): path = fileserver + "/" + newfilename payload = {} payload['sourcePath'] = path req = '{}/sys/file/data-group/{}'.format(url, dgfname) resp = rq.patch(req, json.dumps(payload)) print("update_edg_file, name: {}, PATCH response: {}".format(dgfname, resp)) # in main ... url_base = 'https://%s/mgmt/tm' % hostname rs = requests.session() rs.auth = (username, password) rs.verify = False rs.headers.update({'Content-Type':'application/json'}) .... update_edg_file(rs, url_base, external_file_server, filename, edg_file_name)
The update is pretty quick.
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