Add index to event store call
This commit is contained in:
parent
b0efd9d35c
commit
99d7ac6a2d
@ -12,18 +12,12 @@ ENTITY_IDENT_URL = 'http://entityident:5002/api/v1/resources/'
|
||||
EVENT_STORE_URL = 'http://eventstore:5001/api/keys/'
|
||||
|
||||
|
||||
@app.route('/')
|
||||
def hello_world():
|
||||
return 'Hello World'
|
||||
|
||||
|
||||
|
||||
@app.route('/api/v1/resources/car_events', methods=['GET'])
|
||||
def get_cars_events():
|
||||
vin = request.args.get('vin')
|
||||
|
||||
try:
|
||||
response = requests.get(EVENT_STORE_URL + 'DAF:' + vin + '/')
|
||||
response = requests.get(EVENT_STORE_URL + 'DAF:' + vin + '/0/')
|
||||
cars = json.loads(response.text)
|
||||
|
||||
except requests.exceptions.ConnectionError as e:
|
||||
@ -32,9 +26,9 @@ def get_cars_events():
|
||||
|
||||
return json_util.dumps({'cursor': cars})
|
||||
|
||||
|
||||
@app.route('/api/v1/resources/cars', methods=['GET'])
|
||||
def get_cars():
|
||||
|
||||
try:
|
||||
response = requests.get(ENTITY_IDENT_URL + 'cars')
|
||||
cars = response.json()['cursor']
|
||||
@ -48,7 +42,6 @@ def get_cars():
|
||||
|
||||
@app.route('/api/v1/resources/traffic_lights', methods=['GET'])
|
||||
def get_traffic_lights():
|
||||
|
||||
try:
|
||||
response = requests.get(ENTITY_IDENT_URL + 'traffic_lights')
|
||||
traffic_lights = response.json()['cursor']
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user