in lambda/vpcgraph.py [0:0]
def check_loader_status(neptune_url, load_id):
headers = {
'Content-Type': 'application/json'
}
http = urllib3.PoolManager()
url = neptune_url + "/" + load_id + "?details=true&errors=true"
print(url)
# Check Neptune Loader Status
response = http.request(
'GET',
url,
headers=headers
)
print(response.status)
print(response.data.decode('utf-8'))
if response.status != 200:
raise Exception(response.data.decode('utf-8'))
response_json = json.loads(response.data.decode('utf-8'))
status = response_json['payload']['overallStatus']['status']
print(status)
if status == "LOAD_FAILED":
raise Exception("LOAD_FAILED")
if status == "LOAD_COMPLETED":
print("Load completed...")
return True
return False