Child pages
  • cacheManager SDA API

Versions Compared

Key

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

 

This works as of 01-16-2018:

No Format
carbon.dlib.indiana.edu:8101/cacheManager-shortFilenames.cgi/cache/MDPI_40000000300048_01_access.mp4


It's at carbon.dlib.indiana.edu:8101/cacheManager.cgi/(urls below)

Here's what the REST api looks like:

All requests return a JSON hash that always include these keys:

...


GET /cacheManager.cgi/cache/(filename)
Get the access URL for a staged item.  If error = 0 and url is not null then the file can be retrieved.  Return values:

error

message

url

0

file is present

URL for accessing file

0

file has been staged, waiting

null

-2

not a file

null

-3

File has not been staged.

null

-1

Invalid filename

null



POST /cacheManager.cgi/cache/(filename)
Request a file to be pulled from HPSS to the cache.  If the request was successful (or the file is already on the cache), error will be 0.

error

message

-4

not found on hpss

-2

is a directory

0

currently on disk

0

object staged

-1

Invalid filename



DELETE /cacheManager.cgi/cache/(filename)
Purge a file from the cache.  It will get removed after 7 days anyway, but if you know you don't need it, you can kill it yourself

error

message

0

file is purged

0

file not found

-1

Invalid filename




GET /cacheManager.cgi/checksum/(filename)
Retrieve a checksum from HPSS.

error

message

checksum

1

File has not been scheduled for checksum

null

0

File has not finished checksumming

null

0

checksum ready

The checksum

-1

Invalid filename

 


The checksum is removed from the server on the first successful read.  The checksum may be the string "*** CHECKSUM VALIDATION MISMATCH ***" if HPSS's checksum didn't match the one it had stored.  Otherwise, it will be the 32-hex-digit checksum.


POST /cacheManager.cgi/checksum/(filename)
Schedule a checksum

error

message

-4

not on hpss

-2

is a directory

0

file to be checksummed

-1

Invalid filename



It doesn't handle subdirectoried things (at this point), and these files are available for testing:
MDPI_40000000054496_01_access.mp4   MDPI_40000000613028_01_access.mp4  
MDPI_40000000054496_01_pres.wav     MDPI_40000000613028_01_pres.wav    
MDPI_40000000054496_01_prod.wav     MDPI_40000000613028_01_prod.wav    
MDPI_40000000300048_01_access.mp4   MDPI_40000000613036_01_access.mp4  
MDPI_40000000300048_01_mezz.mov     MDPI_40000000613036_01_pres.wav    
MDPI_40000000300048_01_pres.mkv     MDPI_40000000613036_01_prod.wav    
MDPI_40000000543944_01_access.mp4   MDPI_40000000692030_01_access.mp4  
MDPI_40000000543944_01_pres.wav     MDPI_40000000692030_01_mezz.mov    
MDPI_40000000543944_01_prod.wav     MDPI_40000000692030_01_pres.mkv    
MDPI_40000000543951_01_access.mp4   MDPI_40000001192451_01_access.mp4  
MDPI_40000000543951_01_pres.wav     MDPI_40000001192451_01_pres.wav    
MDPI_40000000543951_01_prod.wav     MDPI_40000001192451_01_prod.wav    
MDPI_40000000577553_01_access.mp4   MDPI_40000001192451_02_access.mp4  
MDPI_40000000577553_01_pres.wav     MDPI_40000001192451_02_pres.wav    
MDPI_40000000577553_01_prod.wav     MDPI_40000001192451_02_prod.wav    
MDPI_40000000577553_02_access.mp4   MDPI_40000001229337_01_access.mp4  
MDPI_40000000577553_02_pres.wav     MDPI_40000001229337_01_pres.wav    
MDPI_40000000577553_02_prod.wav     MDPI_40000001229337_01_prod.wav    
MDPI_40000000613010_01_access.mp4   MDPI_40000001229337_02_access.mp4  
MDPI_40000000613010_01_pres.wav     MDPI_40000001229337_02_pres.wav    
MDPI_40000000613010_01_prod.wav     MDPI_40000001229337_02_prod.wav