Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

SEAD's restful service api (see http://sead.ncsa.illinois.edu/sead-acr-api ) allows you to read/write/annotate/tag/delete datasets and collections (among other things). These services are used within SEAD's bulk upload/sync command line tool and can be called from Curl or your own code to allow your application to read/write directly to/from ACR spaces.

The sead1.2b.jar file mentioned in the text is available at : https://sead-demo.ncsa.illinois.edu/acr/#dataset?id=tag:sead-data.net,2015:data_Loxx_jF8tEE_oU0mq4f3bw

SEAD's google id for devices is in sead-google.json

 

SEAD Uploader

The SEAD Uploader is a command line tool that can be used to upload or sync portions of your disk with an ACR project space. (The upload speed you achieve will depend on your disk and network speed, but the client itself can manage >10K file uploads and we've seen at least 250MB/minute transfer speeds over a mix of large and small files.). Note: The first time you use the SEADUploader on a machine, it will run through an authentication process with Google (see below).The uploader is invoked ).

Steps to get started:

  1. Please make sure you have JAVA installed on your computer. If you don't, you can download it here: https://java.com/en/download/
  2. Download the SEAD Uploader tool (sead1.2b.jar) here: https://sead-demo.ncsa.illinois.edu/acr/#dataset?id=tag:sead-data.net,2015:data_Loxx_jF8tEE_oU0mq4f3bw
  3. On you computer, open the root directory that contains files and folders you would like to upload to your Project Space in SEAD.
  4. Holding the SHIFT button, right click on your mouse to open a menu. Select the "Open Command Window Here" option.
  5. Once you have the Command Window open, invoke the SEADUploader as

java -cp sead1.2b.jar org.sead.acr.client.SEADUploader <-listonly> <-merge> <-limit<X>> <-ex<Y>> <serverUrl> <directories/files list...>

where:

-listonly: write information about what would/would not be transferred without doing any upload

...

directories/files lists - a list of one or more directory or file names the Uploader should work on. The Uploader will recurse (depth first) through the files and subdirectories contained within any listed directory.

Examples:

java -cp sead1.2b.jar org.sead.acr.client.SEADUploader -listonly https://sead-demo.ncsa.illinois.edu/acr mydir

...

Upload the three listed files if the do not exist in the ACR space

First Time Authentication Process

The SEADUploader requires authentication. SEAD's google id for devices is in sead-google.json. The first time it the SEADUploader is invoked, it will initiate a Google "device" authorization request for SEAD (similar to what you may have seen with Netflix or other services on your TV). The Uploader will generate a code and provide a Google URL.

...

After the first time, the Uploader will use the acquired refresh_token to automatically log in on your behalf. This process requires the information in the sead-google.json file provided with the Uploader, and it will write a refresh.txt file to your disk to remember your login. Deleting "refresh.txt" will cause the Uploader to generate a new code as it did the first time. Deleting sead-google.json (or not having it in the same directory you're invoking the client from) will cause the Uploader to fail.

Help

If you experience problems with using the SEADUploader, please contact SEAD and we will be happy to walk you through the steps. 

Using Curl for Direct Service Invocation

Curl (curl.haxx.se) is a command line tool useful for invoking web services. In addition to the restful services listed at http://sead.ncsa.illinois.edu/sead-acr-api, SEAD provides a command line tool and session management services to simplify authentication:

Authentication and session management:

To acquire a Google access token, invoke the following tool:

...

curl --cookie-jar <temporary cookie file> -d "username=<your email>&googleAccessToken=<your access token" http://<desired ACR space>/acr/api/authenticate

Calling SEAD services

 With a session cookie (generated by the call to /acr/api/authenticate), calling SEAD services is straight forward, For example, 

...

-v (verbose) is a useful flag to see more about the service request/response

Using Curl for Google login:

Curl can be used instead of SEAD's SEADGoogleLogin utility to initially register a device (your computer) with Google and acquire SEAD credentials as well as to acquire new tokens over time (see https://developers.google.com/accounts/docs/OAuth2ForDevices for details):

...