How to reset pool statistics using Python API?

I am trying to duplicate the functionality that exists in the GUI of the “Reset” button that exists on the pool statistics page to clear the stats of all members in the current pool. I am able to GET these stats with Python, but cannot figure out how to reset stats such as serverside.bitsIn and serverside.bitsOut. Does anyone have any examples of how this can be accomplished?

It doesn’t appear that this was actually implemented although it was discussed when stats support was added:

I suggest opening an RFE for this on GitHub.

It doesn’t appear that this was actually implemented although it was discussed when stats support was added:

I suggest opening an RFE for this on GitHub.

I went ahead and opened this RFE as I had the related info handy:

I went ahead and opened this RFE as I had the related info handy:

Thanks a lot for doing that. I assumed there wasn’t a reset function, but I was hoping as a workaround I could individually set each value to 0, but I haven’t been able to figure out how to do it.

Thanks a lot for doing that. I assumed there wasn’t a reset function, but I was hoping as a workaround I could individually set each value to 0, but I haven’t been able to figure out how to do it.

The stats class is read-only, unfortunately:

The stats class is read-only, unfortunately:

We need to add the ability to reset stats in the SDK, which as Jason indicated is being tracked in issue 1454, but natively via rest you can do this like this for now:

POST /mgmt/tm/ltm/pool {"command": "reset-stats", "name": "testpool"}