paulbsd-salt/states/_modules/bl.py

16 lines
361 B
Python

#!/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