This commit is contained in:
parent
39dbd4e073
commit
a8a3f1622b
@ -8,14 +8,14 @@ import dateutil.parser
|
|||||||
|
|
||||||
def discovery(url="http://localhost:8898"):
|
def discovery(url="http://localhost:8898"):
|
||||||
ret = {"data": []}
|
ret = {"data": []}
|
||||||
req = urlopen(url=f"{url}/v1/jobs")
|
|
||||||
try:
|
try:
|
||||||
|
req = urlopen(url=f"{url}/v1/jobs")
|
||||||
for res_value in json.loads(req.read()):
|
for res_value in json.loads(req.read()):
|
||||||
if not res_value["disabled"]:
|
if not res_value["disabled"]:
|
||||||
ret["data"].append({"{#SERVICE}": res_value["name"]})
|
ret["data"].append({"{#SERVICE}": res_value["name"]})
|
||||||
return json.dumps(ret)
|
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
return f"error: {err}"
|
return f"error: {err}"
|
||||||
|
return json.dumps(ret)
|
||||||
|
|
||||||
def status(url="http://localhost:8898", task_name=""):
|
def status(url="http://localhost:8898", task_name=""):
|
||||||
ret = ""
|
ret = ""
|
||||||
|
Loading…
Reference in New Issue
Block a user