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.

 

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 as

...

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

...

First Time Authentication Process

The SEADUploader requires authentication. The first time it 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.

Using a browser on any machine, you can go to the URL and enter the code.

Once you've completed that, hit <enter> and the SEADUploader will continue and acquire a Google token it will use to authenticate you to SEAD.

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.

 

Using Curl for Direct Service Inovcation

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:

...

The first invocation will initiate a Google "device" authorization process as with the SEADUploader: You will see messages such as:

Did not find stored refresh token. Initating first-time device authorization request.

...

Once you've entered the code in a browser and hit <return>, the process will complete with information as in the example below:

Proceeding
New Access Token is: ya29.KgD2pVWLsA5TBR4AAACbQLkXOa0nnxD0Es2taQPbx5ebeKR0BJ02VmMJS-7CXg
Expires in 3600 seconds

...

This access token can then be used to login to SEAD and retrieve a session cookie that can be used for all subsequent service requests: 

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, calling SEAD services is straight forward, For example, 

...