# define some parameters OUT=/dev/stdout HEADERS="Content-type: application/json" URL=http://hostname:port/wmarchive/data # prepare your query.json file {"spec":{"task":"AbcCde09[0-9]", "timerange":[20160101,20160102]}, "fields":["task"]} # single document injection, POST request curl -D $OUT -X POST -H $HEADERS -d query.json $URL # depending on provided timerange you'll either get results # or you'll be given UID of your request which can be used later # to locate your results
# single document retrieval, GET request for provided UID curl -D $OUT -H $HEADERS $URL/UID
import os, json, httplib # get connection to our service conn = httplib.HTTPConnection(host, port) # get data from WMArchive query = dict(spec={"task":"taskName", "timerange":[20160101,20160102]}, fields=["task"]) conn.request("POST", path, json.dumps(query), headers) response = conn.getresponse() print("STATUS", response.status, "REASON", response.reason) # read our results res = response.read() data = json.loads(res)