Skip to content

Commit

Permalink
added new endpoint to engine #596
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Letter committed Feb 24, 2016
1 parent 621b0b6 commit f96b42a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
3 changes: 3 additions & 0 deletions packages/slycat/web/server/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ def abspath(path):
dispatcher.connect("get-global-resource", "/resources/global/{resource:.*}", slycat.web.server.handlers.get_global_resource, conditions={"method" : ["GET"]})
dispatcher.connect("get-model-array-attribute-chunk", "/models/:mid/arraysets/:aid/arrays/:array/attributes/:attribute/chunk", slycat.web.server.handlers.get_model_array_attribute_chunk, conditions={"method" : ["GET"]})
dispatcher.connect("get-model-arrayset-data", "/models/:mid/arraysets/:aid/data", slycat.web.server.handlers.get_model_arrayset_data, conditions={"method" : ["GET"]})

dispatcher.connect("get-model-arrayset-data", "/models/:mid/arraysets/:aid/data", slycat.web.server.handlers.post_model_arrayset_data, conditions={"method" : ["POST"]})

dispatcher.connect("get-model-arrayset-metadata", "/models/:mid/arraysets/:aid/metadata", slycat.web.server.handlers.get_model_arrayset_metadata, conditions={"method" : ["GET"]})
dispatcher.connect("get-model-file", "/models/:mid/files/:aid", slycat.web.server.handlers.get_model_file, conditions={"method" : ["GET"]})
dispatcher.connect("get-model", "/models/:mid", slycat.web.server.handlers.get_model, conditions={"method" : ["GET"]})
Expand Down
20 changes: 8 additions & 12 deletions packages/slycat/web/server/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1160,22 +1160,18 @@ def post_model_arrayset_data(mid, aid):
:param aid: artifact id
:return: stream of data
"""

# try and decode the username and password
#TODO: add docs for this endpoint
# try and grab hyperchunk
hyperchunks = None
byteorder = None
require_json_parameter("hyperchunks")
cherrypy.log.error("parsing post arrayset data")
hyperchunks = cherrypy.request.json["hyperchunks"]
try:
cherrypy.log.error("parsing post arrayset data")
hyperchunks = cherrypy.request.json["hyperchunks"]
try:
byteorder = cherrypy.request.json["byteorder"]
except Exception as e:
byteorder = None
cherrypy.log.error("no byteorder provided moving on")
byteorder = cherrypy.request.json["byteorder"]
except Exception as e:
cherrypy.log.error("hyperchunks missing")
slycat.email.send_error("slycat-standard-authentication.py authenticate", "cherrypy.HTTPError 400")
raise cherrypy.HTTPError(400)
byteorder = None
cherrypy.log.error("no byteorder provided moving on")

# parse the hyperchunks
cherrypy.log.error("GET Model Arrayset Data: arrayset %s hyperchunks %s byteorder %s" % (aid, hyperchunks, byteorder))
Expand Down

0 comments on commit f96b42a

Please sign in to comment.