Here is an introduction to the sample of such a script, jmeter_cluster.py The sample application is avaliable on GitHub.
Here is an introduction to the sample implementation of such a script, jmeter_cluster.py. The sample application is available on GitHub.