From 794c8d058d13be5d98c7c91e59516f58bdc59e3f Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Mon, 20 Jul 2020 12:03:15 +0100 Subject: REST API HTML output --- test/rest-api.html | 352 +++++++++++++++++++++++++++++++++++++++++++++++++++++ test/rest-api.org | 4 +- 2 files changed, 355 insertions(+), 1 deletion(-) create mode 100644 test/rest-api.html diff --git a/test/rest-api.html b/test/rest-api.html new file mode 100644 index 0000000..e0a10c7 --- /dev/null +++ b/test/rest-api.html @@ -0,0 +1,352 @@ + + + + + + + + + + + + + + +
+
+

Table of Contents

+ +
+
+

1 PubSeq REST API

+
+

+Here we document the public REST API that comes with PubSeq. The tests +run in the amazing emacs org-babel. See the bottom of this document +for running the tests inside emacs. +

+
+ +
+

1.1 Introduction

+
+

+We built a REST API for COVID-19 PubSeq. The API source code can be +found in api.py. To see if the service is up try +

+ +
+
curl http://covid19.genenetwork.org/api/version
+
+
+ +
+
{
+  "service": "PubSeq",
+  "version": 0.1
+}
+
+
+ +

+The Python3 version is +

+ +
+
import requests
+response = requests.get("http://covid19.genenetwork.org/api/version")
+response_body = response.json()
+assert response_body["service"] == "PubSeq", "PubSeq API not found"
+response_body
+
+
+
+
+ +
+

1.2 Fetch EBI XML

+
+

+PubSeq provides an API that is used to export formats that are +suitable for uploading data to EBI/ENA from our EXPORT menu. This is +documented here. +

+ +
+
requests.get("http://covid19.genenetwork.org/api/ebi/sample-MT32690.1.xml").text
+
+
+
+
+
+ +
+

2 Configure emacs to run tests

+
+

+Execute a code +block with C-c C-c. You may need to set +

+ +
+
(org-babel-do-load-languages
+ 'org-babel-load-languages
+ '((python . t)))
+(setq org-babel-python-command "python3")
+
+
+ +

+To skip confirmations you may also want to set +

+ +
+(setq org-confirm-babel-evaluate nil)
+
+
+
+
+
+
Created by Pjotr Prins (pjotr.public768 at thebird 'dot' nl) using Emacs org-mode and a healthy dose of Lisp!
Modified 2020-07-20 Mon 06:02
. +
+ + diff --git a/test/rest-api.org b/test/rest-api.org index ed31ad0..fa4e9e6 100644 --- a/test/rest-api.org +++ b/test/rest-api.org @@ -9,7 +9,9 @@ for running the tests inside emacs. We built a REST API for COVID-19 PubSeq. The API source code can be found in [[https://github.com/arvados/bh20-seq-resource/tree/master/bh20simplewebuploader/api.py][api.py]]. To see if the service is up try -: curl http://covid19.genenetwork.org/api/version +#+begin_src sh +curl http://covid19.genenetwork.org/api/version +#+end_src #+begin_src js { -- cgit v1.2.3