This has been tested under Python3, and requires the following modules:
Building and testing have been done under PyCharm CE on MacOS.
This script is a very rough POC and is not in any way intended for production.
A copy of the file can be seen in this repository, at bin/delete-vm.py.
/Users/jschmidt/PycharmProjects/mexapi/venv/bin/python /Users/jschmidt/PycharmProjects/mexapi/delete-vm.py
Deleting the AppInst...
{"data":{"message":"Deleting"}}
{"data":{"message":"NotPresent"}}
{"data":{"message":"Deleted AppInst successfully"}}
Deleting the application...
{}
Process finished with exit code 0