PHANTOM REPOSITORY server interface between different PHANTOM tools, storing files and the metadata related to them.
The purpose of the scripts in this folder is to facilitate the use of the Repository, both to upload Files and Metadata and to access the information stored there.
These scripts also aim to serve as an example of the authentication and authorization process based on tokens.
Here is shown the different available scripts. The parameters are filled with some values such the access path to the REPOSITORY as localhost:8000.
Please, replace the values of the parameters for the appropriate values in your case.
A video demonstration of this scripts is available at YOUTUBE Scripts DEMO.
This script takes as authentication inputs the user_id and the user_password and generates an authorization token with a limited life. As the default value, the generated tokens expire after 1 month.
bash get_token.sh -e bob@example.com -pw 1234 -s localhost -port 8000 ;
This script takes a token and returns if it has expired or not, this script does NOT provide any other information such which user generated it.
It is useful only when we don't know if the token has expired.
bash get_token.sh verify_token.sh -t 141r2342135412351.321351235 -s localhost -port 8000 ;
This script takes as inputs the token and the path and filename of the file and returns the FILE in that folder.
bash repo_put.sh -t 141r2342135412351.321351235 -sfp "../web/example.h" -sjp "../web/exampleh.json" -df "mypath/" -dp "main.h" -s localhost -port 8000 ;
Example of json file: exampleh.json
{
"project": "phantom_tools_on_HPC",
"source": "user",
"type":"Usercase",
"name":"HPC",
"content":"src_file"
}
NOTICE: The 'project' and the 'source' are defined in the json file. We provided them in this way instead as a parameter because these fields should remain for a tool working in a project.
This script takes as inputs the token and the path and filename of the file and returns the METADATA of that SINGLE FILE in that folder.
bash repo_get_file.sh -t 141r2342135412351.321351235 -project "phantom_tools_on_HPC" -source "user" -path "mypath/" -file "main.h" -s localhost -port 8000 ;
Alternativelly, we can query for the METADATA for ALL THE FILES IN THE SAME FOLDER with:
bash repo_get_file.sh -t 141r2342135412351.321351235 -project "phantom_tools_on_HPC" -source "user" -path "mypath/" -s localhost -port 8000 ;
This script takes as inputs the token and the path and filename of the file and removes the FILE in that folder and its metadata.
bash repo_delete.sh -t 141r2342135412351.321351235 -project "phantom_tools_on_HPC" -source "user" -df "mypath/" -dp "main.h" -s localhost -port 8000 ;
Here is shown the different available scripts. The parameters are filled with some values such the access path to the REPOSITORY as localhost:8000.
Please, replace the values of the parameters for the appropriate values in your case.
Script for deleting ALL the uploaded files and drop the Metadata stored in the database. It requires confirmation:
bash delete_db.sh -s localhost -port 8000 ;
This script prepares the system for running the users' scripts described below. This script creates the required structure at the database for storing the Metadata:
bash create_db.sh -s localhost -port 8000 ;
This script registers a new user and its password:
bash register_user.sh -e bob@example.com -pw 1234 -s localhost -port 8000 ;
This project is realized through PHANTOM. The PHANTOM project receives funding under the European Union's Horizon 2020 Research and Innovation Programme under grant agreement number 688146.
Find a bug? Have a feature request? Please create an issue.
Montanana, Jose Miguel, HLRS
Cheptsov, Alexey, HLRS
Date | Version | Comment |
---|---|---|
2018-03-22 | 1.0 | First prototype |
Copyright (C) 2018 University of Stuttgart