paulbsd-salt/states/_modules/bl.py

16 lines
361 B
Python
Raw Normal View History

2022-01-02 18:01:47 +01:00
#!/usr/bin/python3
import json
from urllib.request import urlopen, Request
def get_ips(url="https://ipbl.paulbsd.com"):
"""get_jobs fetch jobs from dkron"""
fullurl = f"{url}/ips"
req = Request(method="GET", url=fullurl)
res = urlopen(req)
results = json.loads(res.read())
if res.status == 200:
return results
return None