Webapp URLs

There are a number of helpful URLs available via the webapp which allow you to query reports in a number of ways. They are listed below.

GET /core/all_possible_templates

Core function which populates the sidebar listing of possible reports which a user can execute from the webapp. Called on pretty much every user-facing page. The structure is recursive in its nature, and therefore if a node points to None/undefined then it is treated as a leaf node.

Returns

A JSON which points from a report name to either its children or None if it is a leaf node.

GET /core/all_possible_templates_flattened

Core function which returns a flattened list of possible reports which a user can execute from the webapp.

Returns

A JSON which is a list of all possible templates with their full names.

GET /core/get_all_available_results

Core function for the homepage/index page which returns all available results. Defaults to the top DEFAULT_RESULT_LIMIT results.

Returns

A JSON containing a list of results. The actual payload data is substituted with URLs that would kick off a download, if requested.

GET /core/get_all_templates_with_results/folder/(path: subfolder)
GET /core/get_all_templates_with_results/folder/

Core function for the index.html view which shows the templates which have results available.

Returns

A JSON containing a list of template names with a count of how many results are in each.

GET /core/get_template_parameters/(path: report_name)

Get the parameters of the Notebook Template which is about to be executed in Python.

Parameters
  • report_name – The parameter here should be a “/”-delimited string which mirrors the directory structure of the notebook templates.

Returns

Get the parameters of the Notebook Template which is about to be executed in Python syntax.

GET /core/user_profile

A helper URL which returns the user profile as specified by the incoming headers. Useful if running the webapp behind an OAuth proxy which provides these headers.

Returns

A JSON of the available user information.

GET /core/version

Core function which returns the Notebooker version number.

Returns

A JSON mapping from “version” to the string repr of the version number.

GET /folder/(path: subfolder)
GET /

The index page which shows cards of each report which has at least one result in the database.

GET /result_download_ipynb/(path: report_name)/(job_id)

Allows a user to download the raw .ipynb output from storage.

Parameters
  • report_name – The name of the report.

  • job_id – The UUID of the report.

Return

A download of the .ipynb as requested. 404s if not found.

GET /result_download_pdf/(path: report_name)/(job_id)

Allows a user to download the PDF output from storage.

Parameters
  • report_name – The name of the report.

  • job_id – The UUID of the report.

Return

A download of the PDF as requested. 404s if not found.

GET /result_html_render/(path: report_name)/(job_id)

Returns the HTML render of the .ipynb output of notebook execution. In the webapp this is rendered within an iframe. In this method, we either:

  • present the HTML results, if the job has finished

  • present the error, if the job has failed

  • present the user with some info detailing the progress of the job, if it is still running.

Parameters
  • job_id – The UUID of the report which we are accessing.

  • report_name – The name of the report

Return

The HTML rendering of the .ipynb for the given report_name & job_id.

GET /result_html_render/(path: report_name)/(job_id)/resources/(path: resource)

Returns resources, such as stylesheets and images, which are requested by the HTML rendering of the .ipynb.

Parameters
  • report_name – The name of the report.

  • resource – The relative path to the resource, as saved on disk during execution and saved into storage.

  • job_id – The UUID of the report.

Return

A download of the data as requested. 404s if not found.

GET /result_html_render/(path: report_name)/latest

Returns the HTML render of the .ipynb output of notebook execution. In the webapp this is rendered within an iframe. Searches the database for the last result as of the given date, regardless of status. Notebook parameters can be specified as request args, e.g. ?ticker=AAPL. In this method, we either:

  • present the HTML results, if the job has finished

  • present the error, if the job has failed

  • present the user with some info detailing the progress of the job, if it is still running.

Parameters
  • report_name – The name of the report

Return

The HTML rendering of the .ipynb for the latest successful execution of the given report_name.

GET /result_html_render/(path: report_name)/latest-all

This URL will ignore all paramterisation of the report and return the latest HTML output of any run for a given report name, regardless of its status. In this method, we either:

  • present the HTML results, if the job has finished

  • present the error, if the job has failed

  • present the user with some info detailing the progress of the job, if it is still running.

Parameters
  • report_name – The name of the template which we want to get the latest version of.

Return

The HTML render of the absolute-latest run of a report, regardless of parametrization.

GET /result_html_render/(path: report_name)/latest-successful

Returns the HTML render of the .ipynb output of notebook execution. In the webapp this is rendered within an iframe. Searches the database for the last successful execution of this report_name. Notebook parameters can be specified as request args, e.g. ?ticker=AAPL. In this method, we either:

  • present the HTML results, if the job has finished

  • present the error, if the job has failed

  • present the user with some info detailing the progress of the job, if it is still running.

Parameters
  • report_name – The name of the report.

Return

The HTML rendering of the .ipynb for the latest successful execution of the given report_name.

GET /result_html_render/as_of/(date: as_of)/(path: report_name)/latest

Returns the HTML render of the .ipynb output of notebook execution. In the webapp this is rendered within an iframe. Searches the database for the last result as of the given date, regardless of status. Notebook parameters can be specified as request args, e.g. ?ticker=AAPL. In this method, we either:

  • present the HTML results, if the job has finished

  • present the error, if the job has failed

  • present the user with some info detailing the progress of the job, if it is still running.

Parameters
  • report_name – The name of the report.

  • as_of – The maximum date up to which we are searching for any executions.

Return

The HTML rendering of the .ipynb for the latest execution of the given report_name.

GET /result_html_render/as_of/(date: as_of)/(path: report_name)/latest-all

This URL will ignore all paramterisation of the report and get the latest of any run for a given report name, Up to a given as_of date. In this method, we either:

  • present the HTML results, if the job has finished

  • present the error, if the job has failed

  • present the user with some info detailing the progress of the job, if it is still running.

Parameters
  • report_name – The name of the template which we want to get the latest version of, up to and including as_of.

  • as_of – The maximum date of reports which we want to see.

Return

The HTML render of the absolute-latest run of a report, regardless of parametrization.

GET /result_html_render/as_of/(date: as_of)/(path: report_name)/latest-successful

Returns the HTML render of the .ipynb output of notebook execution. In the webapp this is rendered within an iframe. Searches the database for the last successful execution as of the given date. Notebook parameters can be specified as request args, e.g. ?ticker=AAPL. In this method, we either:

  • present the HTML results, if the job has finished

  • present the error, if the job has failed

  • present the user with some info detailing the progress of the job, if it is still running.

Parameters
  • report_name – The name of the report.

  • as_of – The maximum date up to which we are searching for any executions.

Return

The HTML rendering of the .ipynb for the last successful execution of report_name as of the given date.

GET /result_listing/(path: report_name)

The index page which returns a blank table which is async populated by /core/all_available_results. Async populating the table from a different URL means that we can lock down the “core” blueprint to only users with correct privileges.

GET /result_view_stdout/(path: report_name)/(job_id)

Gets the stdout for the completed job.

Parameters
  • report_name – The name of the report.

  • job_id – The UUID of the report.

Return

The stdout for the job. 404s if not found.

GET /results/(path: report_name)/(job_id)

Renders the full results page for a given report_name/job_id combination. Most usually accessed from the main page.

Parameters
  • job_id – The UUID of the report which we are accessing.

  • report_name – The name of the report

Return

The HTML rendering of the results page for a given report_name/job_id combo.

GET /results/(path: report_name)/latest

Renders the full results page for a report_name. This searches the database for the last completed report for the given report_name.

Parameters
  • report_name – The name of the report

Return

The HTML rendering of the results page for the latest successful execution of the given report_name.

GET /status/(path: report_name)/(job_id)

Returns the status of a given report. If it is no longer running, a results_url is provided which should show the HTML output of the report (regardless of whether it succeeded or failed.)

Parameters
  • report_name – The name of the report which we are running.

  • job_id – The UUID of the job which we ran.

Return

A JSON which contains “status” and either stdout in “run_output” or a URL to results in “results_url”.

GET /status/(path: report_name)/latest

Searches for the latest status of the given report_name/override args combination, and returns the status with a redirect URL or stdout.

Parameters
  • report_name – The name of the report which we are searching for the latest status of.

Return

A JSON which contains “status” and either stdout in “run_output” or a URL to results in “results_url”.