-
Install the dependencies using
pip install -r requirements.txt. -
Set up a Globus account.
-
You need to be running Globus-Personal-Connect on the computer and set up an endpoint.
-
Setup an account on DataFed.
-
Setup DataFed:
In your terminal run
datafed setupEnter your username and password
-
Find your globus endpoint ID and type the following command
datafed ep default set <endpoint_name_here>.
-
Run
fastapi run local_server.pyto start the local API server. -
The server includes routes:
-
login: Logs the user into DataFed. Post body parameters:username: Globus ID.password: Globus password.
-
logout: Logs the user out of DataFed. -
send_file: Uploads an.ibwfile to DataFed.Example:
http://127.0.0.1:8000/send_file//home/user/somewhere/AFM_to_DataFed/test_data/HiGl_m750506.ibw?collection_id=1&record_name=HiGl1Parameters:
file_path: Full path to the file. Passed at the end of the URL. Including a second / like in the example is required as it is interpreted as part of the path.collection_id: Collection ID on DataFed. Passed as a query parameter.record_name(optional): Name to be given to the record. If not provided, will default to the name of the file sans extension.
-
shutdown: Shuts down the API server.
-