@Studmuffn1134 should be available in XO vm, it was atleast for me, I just used the XO installer script from github.
I did a quick search with xo cli now
xo-cli list-commands | egrep 'host.'
in case it looks weird "\." is just to escape the "." which just tells regex I am looking for an actual "."
import aiohttp
import asyncio
from jsonrpc_websocket import Server
async def routine():
async with aiohttp.ClientSession() as client:
server = Server('ws://[yourXO]/api/', client)
await server.ws_connect()
# signIn required
result = await server.session.signIn(username='[yourXOusername]', password='[yourXOPassword]') # email attribute is working in place of username
#hard shutdown VM
#result = await server.vm.stop(id='3f32beeb-ab3f-a8ac-087d-fdc7ed061b58', force=(bool(1)))
#clean Shutdown VM
#result = await server.vm.stop(id='3f32beeb-ab3f-a8ac-087d-fdc7ed061b58', force=(bool(0)))
#bypassbackup and bypassevacuate set off by default but include for wholeness of parameters
result = await server.host.stop(id=[hostUUID],bypassBackupCheck=(bool(0)),bypassEvacuate=bool(0))
print (result)
asyncio.get_event_loop().run_until_complete(routine())
I just built all examples into one, here in the end is the host.stop example also