1
0
Fork 0
mirror of https://github.com/ThomasGsp/HyperProxmox.git synced 2025-03-09 15:40:18 +00:00

API update for mongoDB query

This commit is contained in:
Tlams 2018-02-07 17:59:47 +00:00
parent c6584dec25
commit bd0ccfe48a
3 changed files with 42 additions and 18 deletions

View file

@ -10,7 +10,6 @@
from core.modules.mod_proxmox import *
from core.modules.mod_database import *
from core.modules.mod_analyst import *
from core.modules.mod_crawler import *
from core.modules.mod_access import *
from core.libs.hcrypt import *
from netaddr import iter_iprange
@ -65,11 +64,10 @@ class Core:
# GENERAL FUNCTIONS #
#######################
"""
def is_json(myjson):
def is_json(selmyjson):
try:
json_object = json.loads(myjson)
except ValueError, e:
json.loads(myjson)
except ValueError as e:
return False
return True
@ -79,7 +77,7 @@ class Core:
else:
return json_decode({"value": "Bad request"})
def generalquerycacheinfra(self, dest, date, cluster, node, vmid):
def generalquerycacheinfra(self, dest, date, cluster=None, node=None, vmid=None):
if dest == "instances":
return self.mongo.get_instance(date, cluster, node, vmid)
elif dest == "nodes":