This request is quite common. Here Link is the simple script based on old one published by dany_ many years ago.
On github you can find https://github.com/aruba/arubaos8-example-scripts/tree/master with example scripts. Some work is needed to update those examples to new AOS8 version.
Best, Gorazd
------------------------------
Gorazd Kikelj
MVP Expert 2023
------------------------------