f5-common-python
f5-common-python copied to clipboard
inheritedTrafficGroup Can not be modified. Bug?
I am trying to change my logging profile
newAppSvc = mgmt.tm.sys.application.services.service.load(name=CURRENT_AS_NAAM, partition="Test")
newAppSvc.lists.append({"name": "sect_AdditionalFeatures__mchc_LoggingProfiles", "value": oldLoggingProfiles})
newAppSvc.update()
After the update the correct logging profile is added but the inheritedTrafficGroup is changed to false. I tried to reset it to true with the following code but had the same result:
newAppSvc.inheritedTrafficGroup='true'
newAppSvc.update()
Is there some way that I can use the update() function for this without it changing the inheritedTrafficGroup value?
Please use modify() function instead, update() runs on PUT HTTP method and that causes undefined features to be replaced by default in BIGIP. Let me know if this works with modify()
Thank you for your feedback. That is the info I also found online and I tried modify() but was not able to get it to work. Are you maybe able to give me an example of how the modify patch part should look like?
modify(inheritedTrafficGroup='true') you would use keyword arguments as a parameter
does this answer your question @Zoda123 ?
No unfortunately it does not :/
It gives the following error:
File "MoveAppServicePartition.py", line 172, in <module> newAppSvc.modify(inheritedTrafficGroup='true') File "/usr/local/lib/python2.7/dist-packages/f5/bigip/resource.py", line 409, in modify self._modify(**patch) File "/usr/local/lib/python2.7/dist-packages/f5/bigip/resource.py", line 401, in _modify response = session.patch(patch_uri, json=patch, **requests_params) File "/usr/local/lib/python2.7/dist-packages/icontrol/session.py", line 272, in wrapper raise iControlUnexpectedHTTPError(error_message, response=response) icontrol.exceptions.iControlUnexpectedHTTPError: 400 Unexpected Error: Bad Request for uri: https://10.10.10.1:443/mgmt/tm/sys/application/service/~Test~ACC_TEST2.app~ACC_TEST2/ Text: u'{"code":400,"message":"one or more properties must be specified","errorStack":[],"apiError":26214401}'
Thanks for the help!