1
0
mirror of https://github.com/gryf/ferrit.git synced 2026-02-07 08:45:53 +01:00
Files
ferrit/gerrit_fake_http_server.py
gryf 802cce3f83 Added new REST endpoints.
Two new endponds added:

- /a/plugins/events-log/events/
- /a/changes
2019-11-01 08:16:43 +01:00

47 lines
1.5 KiB
Python

import bottle
@bottle.route('/plugins/events-log/')
def events_log(params=None):
return ''
@bottle.route('/a/projects/')
def projects(params=None):
"""
Possible params (accessible via bottle.request.params) is 'd'
"""
return {"All-Projects": {"id": "All-Projects",
"description": "all projects",
"state": "ACTIVE",
"web_links": [{"name": "browse",
"url":
"/plugins/gitiles/All-Projects",
"target": "_blank"}]},
"All-Users": {"id": "All-Users",
"description": "users",
"state": "ACTIVE",
"web_links": [{"name": "browse",
"url": "/plugins/gitiles/All-Users",
"target": "_blank"}]},
"DEDICATED": {"id": "DEDICATED",
"state": "ACTIVE",
"web_links": [{"name": "browse",
"url": "/plugins/gitiles/DEDICATED",
"target": "_blank"}]}}
@bottle.post('/a/changes')
def changes(param=None):
print(param)
print(bottle.request.json)
pass
@bottle.route('/a/plugins/events-log/events/')
def events(t1=None):
return {}
bottle.run(host='localhost', port=8181, debug=True)