Ejemplo n.º 1
0
def delete_snippet(request):
  params = request.POST
  require_fields(params, ('service', 'snippet', 'token'))
  service_controllers.delete_snippet(
      params['service'], params['snippet'], params['token'])
  return success_response()
Ejemplo n.º 2
0
def query(request):
  params = request.GET
  require_fields(params, ('service', 'query', ('max_count', int)))
  result = algorithms.query(
      params['service'], params['query'], int(params['max_count']))
  return api_response(result)
Ejemplo n.º 3
0
def create_service(request):
  params = request.POST
  require_fields(params, ('service'))
  service = service_controllers.create_service(params['service'])
  return api_response(service.token)