Mediaflux API
Mediaflux can be accessed programmatically via various Application Programming Interfaces (APIs). Mediaflux is a service-oriented architecture - pretty much everything you do with it executes a service in the Mediaflux server. However, to access those services, you need a client, such as Desktop (Browser, HTTPS Protocol) (browser based client) or Mediaflux Explorer (HTTPS Protocol) (Java GUI client).
It's also possible to reach all of the service layer with clients via:
- Java - the Java API is provided by Arcitecta through a .jar file. One can write and execute Java clients that use this directly.
- Bash - a Java client is generally wrapped in a script for execution. It is very common to wrap them in a Unix script via a shell like Bash.
- A specific Java client that is supplied with Mediaflux is aterm (Java command line client). It is also very common to wrap aterm commands in Bash scripts for convenience, or even just type them dynamically into a Bash shell terminal window.
- Tcl - Tcl scripts can be executed via the aterm client. aterm has a built in Tcl interpreter so this is a powerful and easy way to script with the Mediaflux service layer. Tcl scripts can be sourced from the aterm GUI or run using aterm in nogui mode.
- Python - a Python module is provided by Research Computing Services. It allows native Python scripting to work with the Mediaflux API
Bash Scripting with aterm
- The first step is to install a Java 8 JDK on your client computer (if it is not already installed). You can get Java from http://www.oracle.com/technetwork/java/javase/downloads/index.html.
- Now download and install the aterm.jar file. See the Software Downloads page.
- See Scripting with Mediaflux aterm
- By including your full credential in the aterm configuration file, you can now issue aterm directives from the Unix shell (interactively or in a script)
- Now you can use aterm on the command line (try issuing a command like
server.uuid)
Tcl Scripting with aterm
- Run the aterm application
- Write your Tcl script
Execute the script with aterm
ATERM> source <path to script>/<name of script>.tcl