Tring to maintain an access policy using restAPI APM. Need to add or remove a policy item from the list of policy items. Tried this:
I have run into the same issue with pretty much all lists on the F5. For instance, maintaining iRules. Usually just load the existing list into memory with a GET request, manipulate this list, and then repost via API to make changes. This is much easier if you use Python and built in capabilities for data types rather than command line and curl. Since you may eventually look at automation with tools like Ansible, you may want to make that conversion sooner than later 🙂
It is quite frustrating that in the Doc they have /items as an array property while trying to access it there is "403, Operation is not allowed on this level" error message.
I dont know why it is not accessible. Life would be so much easier not having to get all items first, then comparison, add and removal finally replacing the whole list.
I agree. Sadly, these are the cards we have been dealt.
Another way is declarative FAST templates. Maintain a golden JSON config in github. Making a change? Modify the JSON config, save, and check out the new version, loading it into the F5 via FAST templating. This may be easier than multiple API calls... perform heavy lifting off F5 unit, and then take the desired config and push it once.