json
This commit is contained in:
parent
e93bf16bf7
commit
b03ad0df9a
4
main.py
4
main.py
@ -1,14 +1,14 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
from bottle import run, route, request, template,get ,post
|
||||
import libvirt
|
||||
import libvirt, json
|
||||
session = libvirt.open('qemu:///system')
|
||||
|
||||
def listVDS():
|
||||
VdsListVar = list()
|
||||
for domain in session.listAllDomains(0):
|
||||
VdsListVar.append(dict(name=domain.name(),state=domain.isActive()))
|
||||
return VdsListVar
|
||||
return json.dumps(VdsListVar)
|
||||
|
||||
@route('/')
|
||||
def index():
|
||||
|
Loading…
Reference in New Issue
Block a user