Playground API

app.download_file()[source]

Users provide the full path to a specific file they wish to download locally from the platform.

Returns

the file to be downloaded

app.get_d4p_specfem_sfs()[source]

Reads the configuration yaml file of the playground module to retrieve information on the dispel4py and specfem mount paths.

Returns

dict: the properties dictionary to be used in the API endpoints. Contains the home and base directories where execution folders will be stored.

app.list_output_files()[source]

List of the output files of a specific execution. Users need to provide their token in order to be authenticated as well as the name of the execution directory.

Returns

str: json with the name of the output files (logs file and output files)

app.list_runs()[source]

List of all the testing execution directories. Users need to provide their token in order to be authenticated.

Returns

str: json with the paths of the testing directories of the user

app.playground()[source]

Dispel4py execution simulation. The user should provide the name of the output file of the execution, the name of the PE implemenation, its id, the workspace id etc in order to execute an already registred code in the platform

Returns

dict: the logs and the contents of the output file

app.run_command()[source]

Terminal simulation. The user can execute any command or script (if uploaded in the platform) and immediately get the output of the command. The user needs to provide the token, the command to be executed and the name of the directory where results will be stored. If users wish to create a new directory than they need to provide the word new for directory name.

Returns

dict: the logs and the output of the execution as well as the name of the directory that is used in case the users need to reuse it.

app.upload()[source]

API endpoint providing the functionality to upload files in the DARE platform. All files are saved under the user’s directory: ../username/uploads/. The users can provide a folder and a file name. If they provide a folder name the file will be stored under ../username/uploads/<folder name>/<file name>, otherwise the file will be saved directly in the uploads folder of the user.