slycat.web.server.handlers¶
-
slycat.web.server.handlers.
delete_model_parameter
(mid, aid)[source]¶ delete a model artifact :param mid: model Id :param aid: artifact id :return:
-
slycat.web.server.handlers.
delete_project_cache
(pid)[source]¶ clears all the cached images and videos for a project given a project ID :param pid: Project ID :return: status
-
slycat.web.server.handlers.
delete_upload
(uid)[source]¶ cleans up an upload session throws 409 if the session is busy :param uid: :return: not used
-
slycat.web.server.handlers.
get_model_array_attribute_chunk
(mid, aid, array, attribute, **arguments)[source]¶
-
slycat.web.server.handlers.
get_model_statistics
(mid)[source]¶ returns statistics on the model :param mid: model ID :return json: {
“mid”:mid, “hdf5_file_size”:hdf5_file_size, “total_server_data_size”: total_server_data_size, “hdf5_store_size”:total_hdf5_server_size, “model”:model, “delta_creation_time”:delta_creation_time, “couchdb_doc_size”: sys.getsizeof(model)}
-
slycat.web.server.handlers.
get_model_table_chunk
(mid, aid, array, rows=None, columns=None, index=None, sort=None)[source]¶
-
slycat.web.server.handlers.
get_model_table_sorted_indices
(mid, aid, array, rows=None, index=None, sort=None, byteorder=None)[source]¶
-
slycat.web.server.handlers.
get_model_table_unsorted_indices
(mid, aid, array, rows=None, index=None, sort=None, byteorder=None)[source]¶
-
slycat.web.server.handlers.
get_project
(pid)[source]¶ returns a project based on “content-type” header :param pid: project ID :return: Either html landing page of given project or the json representation of the project
-
slycat.web.server.handlers.
get_projects
(_=None)[source]¶ returns either and array of projects or html for displaying the projects :param _: :return:
-
slycat.web.server.handlers.
get_projects_list
(_=None)[source]¶ returns either and array of projects or html for displaying the projects :param _: :return:
-
slycat.web.server.handlers.
get_remote_file
(hostname, path, **kwargs)[source]¶ Given a hostname and file path returns the file given by the path :param hostname: connection host name :param path: path to file :param kwargs: :return: file
-
slycat.web.server.handlers.
get_remote_image
(hostname, path, **kwargs)[source]¶ Given a hostname and image path returns the image given by the path :param hostname: connection host name :param path: path to image :param kwargs: :return: image
-
slycat.web.server.handlers.
get_remote_show_user_password
()[source]¶ checks to see if the application needs to show password :return: json {show:bool, msg:msg}
-
slycat.web.server.handlers.
get_remote_video
(hostname, vsid)[source]¶ Given a hostname and vsid returns the video given by the vsid :param hostname: connection host name :param vsid: video uuid :return: video
-
slycat.web.server.handlers.
get_remote_video_status
(hostname, vsid)[source]¶ Given a hostname and vsid returns the video status given by the vsid :param hostname: connection host name :param vsid: video uuid :return: json
-
slycat.web.server.handlers.
get_remotes
(hostname)[source]¶ Returns {status: True} if the hostname was found in the user’s session :param hostname: connection host name :return: {“status”:status, “msg”:msg}
-
slycat.web.server.handlers.
get_root
()[source]¶ Redirect all requests to “/” to “/projects” Not sure why we used to do that, but after conversion to webpack this is no longer needed, so I changed the projects-redirect config parameter in web-server-config.ini to just “/”
-
slycat.web.server.handlers.
get_sid
(hostname)[source]¶ Takes a hostname address and returns the established sid value base on what is found in the users session raises 400 and 404 :param hostname: name of the host we are trying to connect to :return: sid : uuid for the session name
-
slycat.web.server.handlers.
get_table_metadata
(file, array_index, index)[source]¶ Return table-oriented metadata for a 1D array, plus an optional index column.
-
slycat.web.server.handlers.
get_time_series_names
(hostname, path, **kwargs)[source]¶ Parse a time series csv for all column names :param hostname: connection host name :param path: path to csv file :param kwargs: :return: json object of column names
-
slycat.web.server.handlers.
job_time
(nodes, tasks, size)[source]¶ gives the time in seconds recommended given job meta data :param nodes: number of hpc nodes for job :param tasks: number of tasks per node for job :param size: size of data file used in the job :return: json time in seconds as an integer {‘time-seconds’: 1800}
-
slycat.web.server.handlers.
login
()[source]¶ Takes the post object under cherrypy.request.json with the users name and password and determins with the user can be authenticated with slycat :return: authentication status
-
slycat.web.server.handlers.
logout
()[source]¶ See if the client has a valid session. If so delete it :return: the status of the request
-
slycat.web.server.handlers.
open_id_authenticate
(**params)[source]¶ takes the openid parameter sent to this function and logs in a user :param params: openid params as a dictionary :return: not used
-
slycat.web.server.handlers.
post_log
()[source]¶ send post json {“message”:”message”} to log client errors onto the client server :return:
-
slycat.web.server.handlers.
post_model_arrayset_data
(mid, aid)[source]¶ get the arrayset data based on aid, mid, byteorder, and hyperchunks
requires hyperchunks to be included in the json payload
Parameters: - mid – model id
- aid – artifact id
Returns: stream of data
-
slycat.web.server.handlers.
post_model_files
(mid, input=None, files=None, sids=None, paths=None, aids=None, parser=None, **kwargs)[source]¶
-
slycat.web.server.handlers.
post_project_models
(pid)[source]¶ When a pid along with json “model-type”, “marking”, “name” is sent with POST creates a model and saves it to the database :param pid: project ID for created model :return: json {“id” : mid}
-
slycat.web.server.handlers.
post_remote_command
(hostname)[source]¶ run a remote command from the list of pre-registered commands that are located on a remote agent. :param hostname: name of the hpc host :return: {
“message”: a message that is supplied by the agent, “command”: an echo of the command that was sent to the server and the agent, “error”: boolean describing if there was an agent error, “available_scripts”: [{
“name”: script_name, “description”: script_description, “parameters”: [{
“name”: parameter_name as string, “description”: description of the param string, “example”:example usage string, “type”: field type eg string, int…}]
}]list of available scripts from the agent
}
-
slycat.web.server.handlers.
post_remotes
()[source]¶ Given username, hostname, password as a json payload establishes a session with the remote host and attaches it to the users session :return: {“sid”:sid, “status”:boolean, msg:”“}
-
slycat.web.server.handlers.
post_upload_finished
(uid)[source]¶ ask the server to finish the upload :param uid: upload session ID :return: status of upload
-
slycat.web.server.handlers.
post_uploads
()[source]¶ creates a session for uploading a file to :return: Upload ID
-
slycat.web.server.handlers.
put_model_arrayset_data
(mid, aid, hyperchunks, data, byteorder=None)[source]¶
-
slycat.web.server.handlers.
put_upload_file_part
(uid, fid, pid, file=None, hostname=None, path=None)[source]¶