首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Pysphere获取当前快照名称

Pysphere获取当前快照名称
EN

Stack Overflow用户
提问于 2015-09-08 15:58:46
回答 1查看 553关注 0票数 0

有人知道如何使用pyshpere api获取当前快照名称吗?

https://code.google.com/p/pysphere/wiki/GettingStarted#List_snapshots

EN

回答 1

Stack Overflow用户

发布于 2016-08-03 23:59:30

代码语言:javascript
复制
    # 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

祝好运!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32452262

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档