2010-06-21 01:32:42 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Example client accesses to blob server using curl.
|
|
|
|
#
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2010-08-03 04:05:54 +00:00
|
|
|
# Preupload -- 200 response
|
|
|
|
curl -v \
|
2010-09-08 04:32:12 +00:00
|
|
|
-d camliversion=1 \
|
2010-08-03 04:05:54 +00:00
|
|
|
http://localhost:8080/camli/preupload
|
|
|
|
|
|
|
|
# Upload -- 200 response
|
2010-06-21 01:32:42 +00:00
|
|
|
curl -v -L \
|
2010-08-03 04:05:54 +00:00
|
|
|
-F sha1-126249fd8c18cbb5312a5705746a2af87fba9538=@./test_data.txt \
|
|
|
|
#<the url returned by preupload>
|
2010-06-21 01:32:42 +00:00
|
|
|
|
|
|
|
# Put with bad blob_ref parameter -- 400 response
|
|
|
|
curl -v -L \
|
2010-08-03 04:05:54 +00:00
|
|
|
-F sha1-22a7fdd575f4c3e7caa3a55cc83db8b8a6714f0f=@./test_data.txt \
|
|
|
|
#<the url returned by preupload>
|
2010-06-21 01:32:42 +00:00
|
|
|
|
|
|
|
# Get present -- the blob
|
2010-08-03 04:05:54 +00:00
|
|
|
curl -v http://localhost:8080/camli/\
|
2010-06-21 01:32:42 +00:00
|
|
|
sha1-126249fd8c18cbb5312a5705746a2af87fba9538
|
|
|
|
|
|
|
|
# Get missing -- 404
|
2010-08-03 04:05:54 +00:00
|
|
|
curl -v http://localhost:8080/camli/\
|
2010-06-21 01:32:42 +00:00
|
|
|
sha1-22a7fdd575f4c3e7caa3a55cc83db8b8a6714f0f
|
|
|
|
|
2010-08-03 04:05:54 +00:00
|
|
|
# Check present -- 200 with only headers
|
|
|
|
curl -I http://localhost:8080/camli/\
|
2010-06-21 01:32:42 +00:00
|
|
|
sha1-126249fd8c18cbb5312a5705746a2af87fba9538
|
|
|
|
|
|
|
|
# Check missing -- 404 with empty list response
|
2010-08-03 04:05:54 +00:00
|
|
|
curl -I http://localhost:8080/camli/\
|
2010-06-21 01:32:42 +00:00
|
|
|
sha1-22a7fdd575f4c3e7caa3a55cc83db8b8a6714f0f
|
|
|
|
|
|
|
|
# List -- 200 with list of blobs (just one)
|
2010-11-05 04:38:13 +00:00
|
|
|
curl -v http://localhost:8080/camli/enumerate-blobs?limit=1
|
2010-06-21 01:32:42 +00:00
|
|
|
|
|
|
|
# List offset -- 200 with list of no blobs
|
2010-08-03 04:05:54 +00:00
|
|
|
curl -v http://localhost:8080/camli/enumerate-blobs?after=\
|
2010-06-21 01:32:42 +00:00
|
|
|
sha1-126249fd8c18cbb5312a5705746a2af87fba9538
|