/search
Search is used for the $host variable, it simply query's the SYS_METRICS_INDEX and returns all of the unique different Host keys.
@app.route('/search', methods=methods)
@cross_origin()
def find_metrics():
req = request.get_json()
if req['target'] == "hosts":
retval=[]
ts = gridstore.get_container("SYS_METRICS_INDEX")
tql = "select *"
query = ts.query(tql)
rs = query.fetch(False)
while rs.has_next():
data = rs.next()
retval.append(data[0])
return jsonify(retval)
return jsonify([])