API endpoint /api/nodes/tagged/<tag>

This endpoint returns nodes in public projects that have the given tag.
The returned JSON is cached for 5 minutes.
This commit is contained in:
2018-09-06 12:19:03 +02:00
parent f54e56bad8
commit e19dd27099
3 changed files with 135 additions and 3 deletions

View File

@@ -760,6 +760,8 @@ class PillarServer(BlinkerCompatibleEve):
coll.create_index([('properties.status', pymongo.ASCENDING),
('node_type', pymongo.ASCENDING),
('_created', pymongo.DESCENDING)])
# Used for asset tags
coll.create_index([('properties.tags', pymongo.ASCENDING)])
coll = db['projects']
# This index is used for statistics, and for fetching public projects.