I have a list of VMs and I'd like to get each VM's status (ReadyRole/Stopped/StoppedDeallocated) using Azure's Python SDK.
I have done this in a bash terminal using azure cli commands and a combination of grep,tail and such utils but I'd like to do that in python script using Azure's SDK.
With the help of azure cli I run in a shell script azure vm list and then grep my way to get the status of the VMs.
I've been looking into servicemanagementservice.py of Azure SDK but I can't find a function like get_role_status(). list_hosted_services() and get_hosted_service_properties don't seem to provide the info I want, unless I'm missing something.
Can anyone point me towards a solution?

get_role(github.com/Azure/azure-sdk-for-python/blob/master/azure/…) helps?