common-workflow-language / cwlviewer

A web application to view and share Common Workflow Language workflows
https://view.commonwl.org/
Apache License 2.0
45 stars 28 forks source link

API for post returning 200 #222

Open swzCuroverse opened 5 years ago

swzCuroverse commented 5 years ago

Had working code and now every cwl workflow I try with the post API just returns a 200. Using the API demo code.

swzCuroverse commented 5 years ago
import requests
import time
import os
import glob

BASE_URL = 'https://view.commonwl.org/workflows'
#workflowurl = 'https://github.com/curoverse/l7g/blob/master/cwl-version/clean/cwl/tiling_clean_gvcf.cwl'
workflowurl = 'https://github.com/curoverse/l7g/blob/master/cwl-version/convert2fastj/gvcf_version/cwl/tiling_convert2fastj_gvcf.cwl'
HEADERS = {
    'user-agent': 'my-app/0.0.1',
    'accept': 'application/json'
}
#workflowurl = "https://github.com/common-workflow-language/workflows/tree/master/workflows/compile/compile1.cwl"

addResponse = requests.post(BASE_URL,
                            data={'url': workflowurl}, headers = HEADERS)

print(addResponse.status_code)
swzCuroverse commented 5 years ago

After some more digging it looks like for some reason it is returning the workflow response instead of the standard post response. Not sure why -- maybe if it goes through the queue too fast and/or already exists or a bug? {"retrievedFrom":{"repoUrl":"https://github.com/curoverse/l7g.git","branch":"master","path":"cwl-version/convert2fastj/gvcf_version/cwl/tiling_convert2fastj_gvcf.cwl","packedId":null,"url":"https://github.com/curoverse/l7g/blob/master/cwl-version/convert2fastj/gvcf_version/cwl/tiling_convert2fastj_gvcf.cwl","rawUrl":"https://raw.githubusercontent.com/curoverse/l7g/master/cwl-version/convert2fastj/gvcf_version/cwl/tiling_convert2fastj_gvcf.cwl","type":"GITHUB"},"retrievedOn":1557257157834,"lastCommit":"c1ccad9f81cd3fc44a9f6e8d3b27acb154ba03cc","label":"Creates a FastJ file for each gVCF by path","inputs":{"aidx":{"label":"Assembly index file","type":"File"},"ref":{"label":"Reference genome","type":"String"},"seqidM":{"label":"Mitochondrial naming scheme for gVCF","type":"String"},"refdirectory":{"label":"Directory of input gVCFs","type":"Directory"},"afn":{"label":"Compressed assembly fixed width file","type":"File"},"reffaM":{"label":"Reference mitochondrial genome in FASTA format","type":"File"},"afnM":{"label":"Compressed mitochondrial assembly fixed width file","type":"File"},"aidxM":{"label":"Mitochondrial assembly index file","type":"File"},"tagdir":{"label":"Compressed tagset in FASTA format","type":"File"},"reffa":{"label":"Reference genome in FASTA format","type":"File"},"refM":{"label":"Mitochondrial reference genome","type":"String"}},"outputs":{"out2":{"label":"Indexed and zipped gVCFs","type":"fb65ad7a692c763547e0a11a65560121[]"},"out1":{"label":"Directories of FastJs","type":"Directory[]"}},"steps":{"step2":{"run":"convertgvcf.cwl","runType":"COMMANDLINETOOL","sources":{"https://w3id.org/cwl/view/git/c1ccad9f81cd3fc44a9f6e8d3b27acb154ba03cc/cwl-version/convert2fastj/gvcf_version/cwl/tiling_convert2fastj_gvcf.cwl#step2/afnM":{"sourceIDs":["afnM"]},"https://w3id.org/cwl/view/git/c1ccad9f81cd3fc44a9f6e8d3b27acb154ba03cc/cwl-version/convert2fastj/gvcf_version/cwl/tiling_convert2fastj_gvcf.cwl#step2/reffa":{"sourceIDs":["reffa"]},"https://w3id.org/cwl/view/git/c1ccad9f81cd3fc44a9f6e8d3b27acb154ba03cc/cwl-version/convert2fastj/gvcf_version/cwl/tiling_convert2fastj_gvcf.cwl#step2/seqidM":{"sourceIDs":["seqidM"]},"https://w3id.org/cwl/view/git/c1ccad9f81cd3fc44a9f6e8d3b27acb154ba03cc/cwl-version/convert2fastj/gvcf_version/cwl/tiling_convert2fastj_gvcf.cwl#step2/ref":{"sourceIDs":["ref"]},"https://w3id.org/cwl/view/git/c1ccad9f81cd3fc44a9f6e8d3b27acb154ba03cc/cwl-version/convert2fastj/gvcf_version/cwl/tiling_convert2fastj_gvcf.cwl#step2/refM":{"sourceIDs":["refM"]},"https://w3id.org/cwl/view/git/c1ccad9f81cd3fc44a9f6e8d3b27acb154ba03cc/cwl-version/convert2fastj/gvcf_version/cwl/tiling_convert2fastj_gvcf.cwl#step2/gffDir":{"sourceIDs":["step1"]},"https://w3id.org/cwl/view/git/c1ccad9f81cd3fc44a9f6e8d3b27acb154ba03cc/cwl-version/convert2fastj/gvcf_version/cwl/tiling_convert2fastj_gvcf.cwl#step2/reffaM":{"sourceIDs":["reffaM"]},"https://w3id.org/cwl/view/git/c1ccad9f81cd3fc44a9f6e8d3b27acb154ba03cc/cwl-version/convert2fastj/gvcf_version/cwl/tiling_convert2fastj_gvcf.cwl#step2/aidx":{"sourceIDs":["aidx"]},"https://w3id.org/cwl/view/git/c1ccad9f81cd3fc44a9f6e8d3b27acb154ba03cc/cwl-version/convert2fastj/gvcf_version/cwl/tiling_convert2fastj_gvcf.cwl#step2/tagdir":{"sourceIDs":["tagdir"]},"step2":{"sourceIDs":["step1"]},"https://w3id.org/cwl/view/git/c1ccad9f81cd3fc44a9f6e8d3b27acb154ba03cc/cwl-version/convert2fastj/gvcf_version/cwl/tiling_convert2fastj_gvcf.cwl#step2/afn":{"sourceIDs":["afn"]},"https://w3id.org/cwl/view/git/c1ccad9f81cd3fc44a9f6e8d3b27acb154ba03cc/cwl-version/convert2fastj/gvcf_version/cwl/tiling_convert2fastj_gvcf.cwl#step2/aidxM":{"sourceIDs":["aidxM"]}}},"step1":{"label":"Create list of gVCF directories to process","run":"getdirs.cwl","runType":"EXPRESSIONTOOL","sources":{"step1":{"sourceIDs":["refdirectory"]}}}},"dockerLink":"https://hub.docker.com/r/arvados/l7g","cwltoolVersion":"1.0.20180525185854","visualisationDot":"digraph workflow {\n graph [\n bgcolor = \"#eeeeee\"\n color = \"black\"\n fontsize = \"10\"\n labeljust = \"left\"\n clusterrank = \"local\"\n ranksep = \"0.22\"\n nodesep = \"0.05\"\n ]\n node [\n fontname = \"Helvetica\"\n fontsize = \"10\"\n fontcolor = \"black\"\n shape = \"record\"\n height = \"0\"\n width = \"0\"\n color = \"black\"\n fillcolor = \"lightgoldenrodyellow\"\n style = \"filled\"\n ];\n edge [\n fontname=\"Helvetica\"\n fontsize=\"8\"\n fontcolor=\"black\"\n color=\"black\"\n arrowsize=\"0.7\"\n ];\n subgraph cluster_inputs {\n rank = \"same\";\n style = \"dashed\";\n label = \"Workflow Inputs\";\n \"afn\" [fillcolor=\"#94DDF4\",label=\"Compressed assembly fixed width file\"];\n \"reffa\" [fillcolor=\"#94DDF4\",label=\"Reference genome in FASTA format\"];\n \"tagdir\" [fillcolor=\"#94DDF4\",label=\"Compressed tagset in FASTA format\"];\n \"reffaM\" [fillcolor=\"#94DDF4\",label=\"Reference mitochondrial genome in FASTA format\"];\n \"ref\" [fillcolor=\"#94DDF4\",label=\"Reference genome\"];\n \"aidx\" [fillcolor=\"#94DDF4\",label=\"Assembly index file\"];\n \"afnM\" [fillcolor=\"#94DDF4\",label=\"Compressed mitochondrial assembly fixed width file\"];\n \"aidxM\" [fillcolor=\"#94DDF4\",label=\"Mitochondrial assembly index file\"];\n \"refdirectory\" [fillcolor=\"#94DDF4\",label=\"Directory of input gVCFs\"];\n \"refM\" [fillcolor=\"#94DDF4\",label=\"Mitochondrial reference genome\"];\n \"seqidM\" [fillcolor=\"#94DDF4\",label=\"Mitochondrial naming scheme for gVCF\"];\n }\n subgraph cluster_outputs {\n rank = \"same\";\n style = \"dashed\";\n labelloc = \"b\";\n label = \"Workflow Outputs\";\n \"out1\" [fillcolor=\"#94DDF4\",label=\"Directories of FastJs\"];\n \"out2\" [fillcolor=\"#94DDF4\",label=\"Indexed and zipped gVCFs\"];\n }\n \"step1\" [label=\"Create list of gVCF directories to process\"];\n \"step2\" [label=\"step2\"];\n \"refdirectory\" -> \"step1\" [label=\"refdirectory\"];\n \"step1\" -> \"step2\" [label=\"gffPrefix\"];\n \"afn\" -> \"step2\" [label=\"afn\"];\n \"reffa\" -> \"step2\" [label=\"reffa\"];\n \"tagdir\" -> \"step2\" [label=\"tagdir\"];\n \"step1\" -> \"step2\" [label=\"gffDir\"];\n \"ref\" -> \"step2\" [label=\"ref\"];\n \"afnM\" -> \"step2\" [label=\"afnM\"];\n \"refM\" -> \"step2\" [label=\"refM\"];\n \"reffaM\" -> \"step2\" [label=\"reffaM\"];\n \"seqidM\" -> \"step2\" [label=\"seqidM\"];\n \"aidx\" -> \"step2\" [label=\"aidx\"];\n \"aidxM\" -> \"step2\" [label=\"aidxM\"];\n \"step2\" -> \"out1\";\n \"step2\" -> \"out2\";\n}\n","licenseLink":"https://raw.githubusercontent.com/curoverse/l7g/master/LICENSE","visualisationXdot":"/graph/xdot/github.com/curoverse/l7g/blob/master/cwl-version/convert2fastj/gvcf_version/cwl/tiling_convert2fastj_gvcf.cwl","visualisationPng":"/graph/png/github.com/curoverse/l7g/blob/master/cwl-version/convert2fastj/gvcf_version/cwl/tiling_convert2fastj_gvcf.cwl","visualisationSvg":"/graph/svg/github.com/curoverse/l7g/blob/master/cwl-version/convert2fastj/gvcf_version/cwl/tiling_convert2fastj_gvcf.cwl","roBundle":"/robundle/github.com/curoverse/l7g/blob/master/cwl-version/convert2fastj/gvcf_version/cwl/tiling_convert2fastj_gvcf.cwl","packed":false,"permalink":"https://w3id.org/cwl/view/git/c1ccad9f81cd3fc44a9f6e8d3b27acb154ba03cc/cwl-version/convert2fastj/gvcf_version/cwl/tiling_convert2fastj_gvcf.cwl","@id":"https://w3id.org/cwl/view/git/c1ccad9f81cd3fc44a9f6e8d3b27acb154ba03cc/cwl-version/convert2fastj/gvcf_version/cwl/tiling_convert2fastj_gvcf.cwl"}