客户端服务:
(只能针对master,不能针对volume)
1)获取一个自动分配的id,唯一的文件标示(如果开始没有volumeid,则第一次执行会创建)
curl http://localhost:9333/dir/assign
2)查看卷id为4所在的地址(针对存在多个volume)
curl http://localhost:9333/dir/lookup?volumeId=3
3)将myphoto.jpg上传到服务器
curl -F file=@/home/chris/myphoto.jpg http://127.0.0.1:8080/3,01637037d6
4)将myphoto.jpg进行存储
curl -F file=@/home/chris/myphoto.jpg http://localhost:9333/submit
5)创建volume数据块
curl -F file=@hello.txt "http://localhost:9333/submit?collection=picture."
curl http://master:9333/dir/assign?collection=pictures
(可以针对volume)
1)删除fid为“3,01637037d6”的数据
curl -X DELETE http://127.0.0.1:8080/3,01637037d6
2)集合删除
curl "http://localhost:8080/admin/delete_collection?collection=some_collection_name."
3)删除某个volumeid
curl "http://localhost:8080/admin/volume/delete?volume=volumeId"
4)挂载volumeId
curl "http://localhost:8080/admin/volume/unmount?volume=volumeId"
5)卸载volumeId
curl "http://localhost:8080/admin/volume/mount?volume=volumeId"
6)查看8080对应volume服务的状态
curl "http://localhost:8080/status?pretty=y"
7)指定数据中心
http://localhost:9333/dir/assign?dataCenter=dc1
8)设置超时时间
curl http://localhost:9333/dir/assign?ttl=3m
curl -F "file=@x.go" http://127.0.0.1:8080/5,01637037d6?ttl=3m
时间单位:
'm', 'h', 'd', 'w', 'M', 'y'.