CetacisCloud 1.0
description
Cetacis cloud is a cloud disk driver. It provide the API for the CetacisCloud_front. You can also use API by terminal.
deployment
go run main.go
go build main.go
nohup ./main &
terminal usage
Let's suggest that we have deployed the service at 127.0.0.1:8080
manage your account.
Admin account is storaged by json file in the ./config/account.json
. you can change the username and password in this file.
login
user is your account and pass is your password.
curl -c cookie.txt -d "user=admin&pass=d1177ad0-8fec-4795-980d-089af487a54a" http://127.0.0.1:8080/api/login
logout
curl -b cookie.txt -d "" http://127.0.0.1:8080/api/logout
check isLogin
curl -b cookie.txt http://127.0.0.1:8080/api/check
download File
filename is the file you want to download.
curl -b cookie.txt -d "" http://127.0.0.1:8080/api/download/{filename} -O
upload file
FILEPATH is the absolute location of the file you want to upload
curl -b cookie.txt http://127.0.0.1:8080/api/upload -F "file=@/FILEPATH"
Check all files.
curl -b cookie.txt http://127.0.0.1:8080/api/files
ShareFile
filename is the file you want to share
curl -b cookie.txt http://127.0.0.1:8080/api/share/{fielname}
and you will get a json which contains a share link after running this command.
GetShareFile
the sharelink is mentioned above.
curl -b cookie.txt http://127.0.0.1:8080/{sharlink}
This command doesn't need auth. No cookies is also work
curl http://127.0.0.1:8080/{sharlink}
Cancel share file
filename is the file you want to cancel share
curl -b cookie.txt http://127.0.0.1:8080/api/share/delete/{filename}
delete file
filename is the file you want to delete.
curl -b cookie.txt http://127.0.0.1:8080/api/delete/{filename}
create a dir
dirname is the dir's name you want to create
curl -b cookie.txt http://127.0.0.1:8080/api/create/dir/{dirname}