Get VM status using Azure Python SDK -


i have list of vms , i'd each vm's status (readyrole/stopped/stoppeddeallocated) using azure's python sdk.

i have done in bash terminal using azure cli commands , combination of grep,tail , such utils i'd in python script using azure's sdk.

with of azure cli run in shell script azure vm list , grep way status of vms.

i've been looking servicemanagementservice.py of azure sdk can't find function get_role_status(). list_hosted_services() , get_hosted_service_properties don't seem provide info want, unless i'm missing something.

can point me towards solution?

base on experience, can every instances status using azure rest api. azure sdk python should have similar method, because functions in azure sdk use same url rest api.
tried use method get_deployment_by_name instances status:

subscription_id = '****-***-***-**' certificate_path = 'current_user\\my\\***' sms = servicemanagementservice(subscription_id, certificate_path) result=sms.get_deployment_by_name("your service name","your deployment name") 

you can role list , check every role property, please see picture: enter image description here


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -