f5-common-python icon indicating copy to clipboard operation
f5-common-python copied to clipboard

inheritedTrafficGroup Can not be modified. Bug?

Open Zoda123 opened this issue 7 years ago • 5 comments

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?

Zoda123 avatar Aug 03 '18 13:08 Zoda123

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()

wojtek0806 avatar Aug 07 '18 09:08 wojtek0806

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?

Zoda123 avatar Aug 07 '18 11:08 Zoda123

modify(inheritedTrafficGroup='true') you would use keyword arguments as a parameter

wojtek0806 avatar Aug 07 '18 12:08 wojtek0806

does this answer your question @Zoda123 ?

wojtek0806 avatar Aug 08 '18 09:08 wojtek0806

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!

Zoda123 avatar Aug 13 '18 11:08 Zoda123