DataManagement

command module
v0.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2025 License: MIT Imports: 22 Imported by: 0

README

DataManagement Service

build status go report card godoc

Data Management for CHESSComputing provides RESTfull access to site's S3 storage.

Prerequisites
  • all operations requires token with appropriate scope, e.g. to get data we can use read scope token, for posting (writing) the data we use token with write scope, and for deletion token with delete scope
  • in order to access DataManagement service the MIN.IO server sohuld be up and runnig
    • the MIN.IO server should be configured with proper user account(s)
    • the access token and access secret should be created and placed under DataManagement.S3 section into foxden configuration, e.g.
DataManagement:
  S3:
    AccessKey: <access_key>
    AccessSecret: <access_secret>
    Endpoint: localhost:8330
    UseSSL: false

For further details of managing users in MIN.IO please consult User Management documentation.

DataManagement service APIs

DataManagement service supports the following (protected) APIs:

# list all buckets in current storage
curl -v -H "Authorization: Bearer $token" \
    http://localhost:8340/storage

# create bucket (s3-bucket)
curl -v -X POST -H "Content-type: application/json" \
    -H "Authorization: Bearer $token" \
    http://localhost:8340/storage/s3-bucket

# delete bucket
curl -v -H "Authorization: Bearer $token" \
    -X DELETE http://localhost:8340/storage/s3-bucket

# upload file:
# take local file at /path/test.zip and upload it to
# S3 object: s3-bucket/archive.zip
curl -v -H "Authorization: Bearer $token" \
    -H "content-type: multipart/form-data" \
    -X POST http://localhost:8340/storage/s3-bucket/archive.zip \
    -F "file=@/path/test.zip"

# get file
curl -H "Authorization: Bearer $token" \
    http://localhost:8340/storage/s3-bucket/archive.zip > archive.zip

# delete file
curl -v -H "Authorization: Bearer $token" \
    -X DELETE http://localhost:8340/storage/s3-bucket/archive.zip

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL