Django views (RESTful API)¶
-
class
workflow_reg.views.
DockerEnvView
(**kwargs)[source]¶ View for the DockerEnv Django instance
-
create
(request, *args, **kwargs)[source]¶ API endpoint, used to create a new DockerEnv instance, i.e. a docker container. It gives also the possibility to also register additional scripts used in the Dockerfile (e.g. entrypoint.sh). Usage: http://domain/workflow_registry/docker/ POST request Example json:
- {
“docker_name”: “name”, “docker_tag”: “tag”, “script_names”: [“script1.sh”, “script2.sh”] “files”: {
“dockerfile”: “bytes”, “script1.sh”: “bytes….”, “script2.sh”: “byteskjjgjgj”
}, “access_token”: “token”
}
-
delete_docker
(request, *args, **kwargs)[source]¶ API endpoint to delete an existing docker container DELETE request to http://domain/workflow-registry/delete_docker/
Example json:
- {
“docker_name”: “name”, “docker_tag”: “tag”, “access_token”: “token”
}
-
download_dockerfile_and_scripts
(request, *args, **kwargs)[source]¶ API endpoint to download a docker container, i.e. the Dockerfile and the relevant scripts GET request to http://domain/workflow-registry/docker/download?docker_name=name&docker_tag=tag
&access_token=token
-
get_docker_by_name_and_tag
(request, *args, **kwargs)[source]¶ API endpoint to retrieve a unique docker container GET request to http://domain/workflow-registry/docker/bynametag?docker_name=name&docker_tag=tag
&access_token=token
-
get_docker_by_user
(request, *args, **kwargs)[source]¶ API endpoint to retrieve all dockers from a specific user GET request to http://domain/workflow-registry/docker/byuser?requested_user=username&access_token=token
-
provide_url
(request, *args, **kwargs)[source]¶ API endpoint to update the URL of the docker image once built POST request to http://domain/workflow-registry/docker/provide_url/
Example json:
- {
“docker_name”: “name”, “docker_tag”: “tag”, “docker_url”: “url”, “access_token”: “token”
}
-
serializer_class
¶
-
update_docker
(request, *args, **kwargs)[source]¶ API endpoint to update an existing docker container POST request to http://domain/workflow-registry/docker/update_docker/
Example json:
- {
“docker_name”: “name”, “docker_tag” “tag”, “update”: {
“tag”: “v2.0”
}, “files”: {
“dockerfile”: “gfgrfghrfgh”
}, “access_token”: “token”
}
-
-
class
workflow_reg.views.
DockerScriptView
(**kwargs)[source]¶ API View for DockerScript Django Model
-
add_script
(request, *args, **kwargs)[source]¶ API endpoint to add a new script to an existing DockerEnv instance POST request to http://domain/workflow-registry/scripts/add/
Example json:
- {
“docker_name”: “name”, “docker_tag”: “tag”, “script_name”: “entrypoint.sh”, “files”: {
“entrypoint.sh”: b”fgfghfhgfgh”
}, “access_token”: “token”
}
-
delete_script
(request, *args, **kwargs)[source]¶ API endpoint to delete an existing docker script DELETE request to http://domain/workflow-registry/scripts/delete/
Example json:
- {
“docker_name”: “name”, “docker_tag”: “tag”, “script_name”: “entrypoint.sh”, “access_token”: “token”
}
-
download_script
(request, *args, **kwargs)[source]¶ API endpoint to download a specific script GET request to http://domain/workflow-registry/scripts/download?docker_name=name&docker_tag=tag
&script_name=scriptname&access_token=token
-
edit_script
(request, *args, **kwargs)[source]¶ API endpoint to update an existing script associated to an existing DockerEnv instance POST request to http://domain/workflow-registry/scripts/edit/
Example json:
- {
“docker_name”: “name”, “docker_tag”: “tag”, “script_name”: “entrypoint.sh”, “files”: {
“entrypoint.sh”: b”fgfghfhgfgh”
}, “access_token”: “token”
}
-
get_script_by_name
(request, *args, **kwargs)[source]¶ API endpoint to retrieve a unique script based on a docker container GET endpoint to http://domain/workflow-registry/scripts/byname?docker_name=name&docker_tag=tag
&script_name=scriptname&access_token=token
-
serializer_class
¶
-
-
class
workflow_reg.views.
WorkflowPartView
(**kwargs)[source]¶ API View for WorkflowPart Django model
-
add_workflow_part
(request, *args, **kwargs)[source]¶ API endpoint to create a new workflow part, associated with a CWL workflow POST request to http://domain/workflow-registry/workflow_parts/add/
Example json
- {
“workflow_name”: “demo_workflow.cwl”, “workflow_version”: “v1.0”, “workflow_part_name”: “arguments.cwl”, “workflow_part_version”: “v1.0”, “spec_name”: “arguments.yaml”, “files”: {
“arguments.cwl”: “grfgtrte”, “arguments.yaml”: “weojfodoj”
}, “access_token”: “token”
}
-
delete_workflow_part
(request, *args, **kwargs)[source]¶ API endpoint to delete an existing workflow part, associated with a CWL workflow POST request to http://domain/workflow-registry/workflow_parts/delete/
Example json
- {
“workflow_name”: “demo_workflow.cwl”, “workflow_version”: “v1.0”, “workflow_part_name”: “arguments.cwl”, “workflow_part_version”: “v1.0”, “access_token”: “token”
}
-
download_workflow_part
(request, *args, **kwargs)[source]¶ API endpoint to download a specific workflow part GET request to http://domain/workflow-registry/workflow_parts/download?workflow_name=workflow_name&
workflow_version=workflow_version& workflow_part_name=workflow_part_name& workflow_part_version=workflow_part_version& access_token=token
-
get_workflow_part_by_name_and_version
(request, *args, **kwargs)[source]¶ API endpoint to get a unique workflow part GET request to http://domain/workflow-registry/workflow_parts/bynameversion?workflow_name=workflow_name&
workflow_version=workflow_version& workflow_part_name=workflow_part_name& workflow_part_version=workflow_part_version& access_token=token
-
serializer_class
¶
-
update_workflow_part
(request, *args, **kwargs)[source]¶ API endpoint to update an existing workflow part, associated with a CWL workflow POST request to http://domain/workflow-registry/workflow_parts/edit/
Example json
- {
“workflow_name”: “demo_workflow.cwl”, “workflow_version”: “v1.0”, “workflow_part_name”: “arguments.cwl”, “workflow_part_version”: “v1.0”, “spec_name”: “arguments.yaml”, “files”: {
“arguments.cwl”: b”grfgtrte”, “arguments.yaml”: b”weojfodoj”
}, “update”: {
“version”: “v1.1”
} “access_token”: “token”
}
-
-
class
workflow_reg.views.
WorkflowView
(**kwargs)[source]¶ API View for Workflow Django Model, which represents a CWL workflow
-
create
(request, *args, **kwargs)[source]¶ API endpoint to create a new workflow. The user can register the workflow parts as well POST endpoint to http://domain/workflow-registry/workflows/
Example json
- {
“workflow_name”: “demo_workflow.cwl”, “workflow_version”: “v1.0”, “spec_file_name”: “spec.yaml”, “docker_name”: “name”, “docker_tag”: “tag”, “workflow_part_data”:[ {
“name”: “arguments.cwl”, “version”: “v1.0”, “spec_name”: “arguments.yaml”
}, {
“name”: “tar_param.cwl”, “version”: “v1.0”, “spec_name”: “tar_param.yaml”
} ], “files”: {
“demo_workflow.cwl”: “fgfghfghf”, “spec.yaml”: “fgfgfgrgrwet”, “arguments.cwl”: “bytes”, “arguments.yaml”: “ejhrthjro”, “tar_param.cwl”: “hjgfruio”, “tar_param.yaml”: “fgriooeroe”
}, “access_token”: “token”
}
-
delete_workflow
(request, *args, **kwargs)[source]¶ API endpoint to delete an existing workflow. DELETE endpoint to http://domain/workflow-registry/workflows/delete_workflow/
Example json
- {
“workflow_name”: “demo_workflow.cwl”, “workflow_version”: “v1.0”, “access_token”: “token”
}
-
download_workflow
(request, *args, **kwargs)[source]¶ API endpoint to download a workflow GET request to http://domain/workflow-registry/donwload?workflow_name=name&workflow_version=version
&dockerized=True&access_token=token
-
get_workflow_by_name_and_version
(request, *args, **kwargs)[source]¶ API endpoint to get unique workflow GET endpoint to http://domain/workflow-registry/workflows/bynameversion?workflow_name=name
&workflow_version=version&access_token=token
-
serializer_class
¶
-
update_docker
(request, *args, **kwargs)[source]¶ API endpoint to update the docker env associated with a specific workflow POST endpoint to http://domain/workflow-registry/workflows/update_docker/
Example json
- {
“workflow_name”: “demo_workflow.cwl”, “workflow_version”: “v1.0”, “docker_name”: “test”, “docker_tag”: “v1.0”, “access_token”: “token”
}
-
update_workflow
(request, *args, **kwargs)[source]¶ API endpoint to update an existing workflow. POST endpoint to http://domain/workflow-registry/workflows/update_workflow/
Example json
- {
“workflow_name”: “demo_workflow.cwl”, “workflow_version”: “v1.0”, “files”: {
“workflow_file”: “fgfghfghf”, “spec_file”: “fgfgfgrgrwet”,
}, “update”: {
“version”: “v1.1”
} “access_token”: “token”
}
-