def testVmRestore(): #连接参数 dataConnect = DataConnect() dataConnect.ip = "192.168.100.19" dataConnect.port = "8080" dataConnect.account = "admin" dataConnect.password = "******" # 还原虚拟机参数,指定已备份的文件 data = "{'shareName':'\\10.10.113.253\cifsserver','userName':'******','passwd':'test123','fileName':'d9ad6d9f-3e5f-1a40-48b8-1ffccd8eb5ed_97_201404071750.xva'}" taskId = VM.vmRestore(dataConnect, data); print taskId
def testVmBackup(): #连接参数 dataConnect = DataConnect() dataConnect.ip = "192.168.100.19" dataConnect.port = "8080" dataConnect.account = "admin" dataConnect.password = "******" # 备份的虚拟机id vmId = "27" # 备份参数 data = "{'shareName':'\\10.10.113.253\cifsserver','userName':'******','passwd':'test123','fileName':'kee'}" taskId = VM.vmBackup(dataConnect, vmId,data) print taskId