diff options
author | Guy Rodrigue Koffi <koffirodrigue@gmail.com> | 2015-10-01 10:56:55 +0200 |
---|---|---|
committer | Guy Rodrigue Koffi <koffirodrigue@gmail.com> | 2015-10-08 11:53:34 +0200 |
commit | 5245db0a6cee1b138e9ce6786f191cae01b919ba (patch) | |
tree | 359672d9b798960509a3e8fb05ea9023aad810cf /result_collection_api/result_collection_api.py | |
parent | 962f4cadc714ace002b9d0106a30c472fc9bf4b1 (diff) |
Updates for result_collection_api
- pod identification : RELENG-33
- add filters on results : RELENG-32 / RELENG-31
- fix bugs on db connection
Change-Id: Ie720bb8028e5bfabd914c57df323b81d40c47fcd
Signed-off-by: Guy Rodrigue Koffi <koffirodrigue@gmail.com>
Diffstat (limited to 'result_collection_api/result_collection_api.py')
-rw-r--r-- | result_collection_api/result_collection_api.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/result_collection_api/result_collection_api.py b/result_collection_api/result_collection_api.py index c04e034..4969577 100644 --- a/result_collection_api/result_collection_api.py +++ b/result_collection_api/result_collection_api.py @@ -15,14 +15,12 @@ Pre-requisites: We can launch the API with this file TODOs : - - use POD name instead of id - logging - json args validation with schemes - POST/PUT/DELETE for PODs - POST/PUT/GET/DELETE for installers, platforms (enrich results info) - count cases for GET on test_projects - count results for GET on cases - - provide filtering on requests - include objects - swagger documentation - setup file @@ -48,7 +46,8 @@ args = parser.parse_args() CONF = APIConfig().parse(args.config_file) # connecting to MongoDB server, and choosing database -db = motor.MotorClient(CONF.mongo_url) +client = motor.MotorClient(CONF.mongo_url) +db = client[CONF.mongo_dbname] def make_app(): @@ -61,7 +60,7 @@ def make_app(): # GET /pods => Get all pods # GET /pods/1 => Get details on POD 1 (r"/pods", PodHandler), - (r"/pods/(\d*)", PodHandler), + (r"/pods/([^/]+)", PodHandler), # few examples: # GET /test_projects |