def list_vms(sync, name, rem): if sync or cache.need_update(): rs = hvclient.get_vm(name) vms = hvclient.parse_result(rs) if rem: cache.remove_cache() cache.update_cache(vms) cache_vms = cache.list_vms() printer.print_list_vms(cache_vms, name)
def snap_ls(by_name, ident): name = cache.get_name(by_name, ident) rs = hvclient.get_vm(name) vms = hvclient.parse_result(rs) cache.update_cache(vms) cache_vms = cache.list_vms() printer.print_list_vms(cache_vms, name) rs_snaps = hvclient.list_vm_snaps(name) snaps = hvclient.parse_result(rs_snaps) printer.print_vm_snaps(snaps, name, vms['ParentSnapshotName'])