-
Notifications
You must be signed in to change notification settings - Fork 100
[HOW TO] Register a plugin via the REST API
Jorge edited this page Apr 18, 2024
·
5 revisions
- Get the plugin representation JSON file by running a container from the plugin's docker image
- Edit the JSON file by adding the
name
anddock_image
keys and their values to the JSON file's dictionary - An admin user (like
chris
) uploads the JSON file to CUBE through a POST request to the admin API/chris-admin/api/v1/
For instance, using the httpie client and assuming that the ChRIS service is running at localhost:8000
:
- Get the plugin representation:
mkdir ~/plugin_json_files
docker run --rm fnndsc/pl-dircopy dircopy --json > ~/plugin_json_files/pl-dircopy.json
-
Add
"name": "pl-dircopy", "dock_image": "fnndsc/pl-dircopy"
key-value pairs to the JSON file's dictionary and save the file -
Upload the JSON file to CUBE:
http -a chris:chris1234 -f POST http://localhost:8000/chris-admin/api/v1/ \
fname@~/plugin_json_files/pl-dircopy.json compute_names='host' \
Accept:application/vnd.collection+json
- Get the plugin representation:
docker run --rm fnndsc/pl-topologicalcopy topologicalcopy --json > ~/plugin_json_files/pl-topologicalcopy.json
-
Add
"name": "pl-topologicalcopy", "dock_image": "fnndsc/pl-topologicalcopy"
key-value pairs to the JSON file's dictionary and save the file -
Upload the JSON file to CUBE:
http -a chris:chris1234 -f POST http://localhost:8000/chris-admin/api/v1/ \
fname@~/plugin_json_files/pl-topologicalcopy.json compute_names='host' \
Accept:application/vnd.collection+json
- Get the plugin representation:
docker run --rm fnndsc/pl-simpledsapp simpledsapp --json > ~/plugin_json_files/pl-simpledsapp.json
-
Add
"name": "pl-simpledsapp", "dock_image": "fnndsc/pl-simpledsapp"
key-value pairs to the JSON file's dictionary and save the file -
Upload the JSON file to CUBE:
http -a chris:chris1234 -f POST http://localhost:8000/chris-admin/api/v1/ \
fname@~/plugin_json_files/pl-simpledsapp.json compute_names='host' \
Accept:application/vnd.collection+json