#!/usr/bin/env python

# Displays adjacent IP addresses, with a limit of 15.

# Runs GetElements to perform a query, and then uses Limit to restrict the
# data set to 15.

import requests
import json
import sys
from gaffer import Gaffer

gr = sys.stdin.read()
gr = json.loads(gr)

query={
    "class": "uk.gov.gchq.gaffer.operation.impl.add.AddElements",
    "validate": True,
    "skipInvalidElements": False,
    "input": gr
}

g = Gaffer("https://analytics.trustnetworks.com/gaffer-threat")
g.use_cert()

url = "/rest/v2/graph/operations/execute"

res = g.post(url, data=json.dumps(query))
print res.status_code


print res.text


