有人知道如何使用pyshpere api获取当前快照名称吗?
https://code.google.com/p/pysphere/wiki/GettingStarted#List_snapshots
发布于 2016-08-03 23:59:30
# This ignores the certificate warning
default_context = ssl._create_default_https_context
ssl._create_default_https_context = ssl._create_unverified_context
# Connect to the VMware instance
server_instance = pysphere.VIServer();
server_instance.connect(ipaddress,username,password)
# Create a VM object of which details are required
vm = server_instance.get_vm_by_name(vmname)
# This gets the status of the VM.
print vm.get_status()
# This gets the current snapshot name.
print vm.get_current_snapshot_name()引用基本库总是一个好主意。下面是pysphere的链接。http://nullege.com/codes/show/src@p@y@pysphere-HEAD@pysphere@.py/173/pysphere.vi_mor.MORTypes
祝好运!
https://stackoverflow.com/questions/32452262
复制相似问题