Cetacis cloud is a cloud disk driver. It provide the API for the CetacisCloud_front. You can also use API by terminal.
- For dev
go run main.go
- For usage
go build main.go
nohup ./main &
Let's suggest that we have deployed the service at 127.0.0.1:8080
Admin account is storaged by json file in the ./config/account.json
. you can change the username and password in this file.
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
curl -b cookie.txt -d "" http://127.0.0.1:8080/api/logout
curl -b cookie.txt http://127.0.0.1:8080/api/check
filename is the file you want to download.
curl -b cookie.txt -d "" http://127.0.0.1:8080/api/download/{filename} -O
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"
curl -b cookie.txt http://127.0.0.1:8080/api/files
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.
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}
filename is the file you want to cancel share
curl -b cookie.txt http://127.0.0.1:8080/api/share/delete/{filename}
filename is the file you want to delete.
curl -b cookie.txt http://127.0.0.1:8080/api/delete/{filename}
dirname is the dir's name you want to create
curl -b cookie.txt http://127.0.0.1:8080/api/create/dir/{dirname}