Blobs

Blobs are file-like objects of raw binary data. Blobs are stored in directory trees inside Boxes.

Blobs are use withing SVNPlace for Backups and Processes, for example, and are available for you to use as you want. You can browse and change your blobs through the web interface and you can also work directly with blobs through an HTTPS interface and api calls. There is also a simple tool, blobcp, which simplifies blob copying.

Sealing a Blob or Directory

A Blob, or blob directory, can be Sealed. The Seals indicate what a blob or directory is, and that its contents are in a known, good state. Any modification after being sealed will remove all the seals. For example, there is a seal for a repository, and for a full backup, and a blob which is a full backup of a repository has both those seals.

Preparing a Sealed blob/directory

When a blob/directory is created, you may list a number of seals. The creation will return a seal tag. Until it is finished, send this tag when you make any modifications to the blob or directory. When all the changes are complete, finalise it and then it is sealed. You may have a sealed directory with several sealed things inside it - pass a list of all the applicable seal tags.

Checking a Seal Isn;'t Broken

While reading a blob/directory, you can check whether its seal has been broken. Before you start, read its seal tag. Once you have finished reading it, check the seal tag hasn't changed.

Blobs with HTTPS

Blobs can be manipulated through https://blob.svnplace.com/, using, for example, curl:

curl https://blobs.svnplace.com/joebloggs/DemoBox/DemoFile.txt

Blob access is secured using basic authentication. Although not recommended, you can use your root password:

curl -u joebloggs:password https://blobs.svnplace.com/joebloggs/DemoBox/DemoFile.txt

or, create a key and use the key and its secret:

curl -u joebloggs:k-0123456789abcdef:KeySecret!KeySecret!KeySecret!KeySecret! https://blobs.svnplace.com/joebloggs/DemoBox/DemoFile.txt

To read a blob use GET. To read a section of a blob, use the RANGE header:

curl https://blobs.svnplace.com/joebloggs/DemoBox/DemoFile.txt -H range=10-334, 400-800

To create/replace a blob use PUT.

echo Hello World | curl -X PUT --data-binary @- https://blobs.svnplace.com/joebloggs/DemoBox/HelloWorld.txt

To extend a blob use POST or PATCH.

echo Something to add after Hello World | curl -X POST --data-binary @- https://blobs.svnplace.com/joebloggs/DemoBox/HelloWorld.txt

To give seals to a blob with PUT, POST or PATCH send a X-Seals header, with the seals comma-separated:

...curl -X PUT -H 'X-Seals : urn/seal/user/svnplace/backup_full,s-0123456789abcdef' --data-bi...

The Seal tag is returned in the response header X-Seal-Tag:

...curl -X PUT -v --dat... -H 'X-Seals:...moBox/HelloWorld.txt 2>&1 >/dev/null | grep X-Seal-Tag

To retain seals during multi-step creation, send a X-Seal-Tags header, with the rage comma-separated:

...curl -X PUT -H 'X-Seal-Tags : SealTag789SealTag789SealTag789SealTag789,SecondTag9SecondTag9SecondTag9SecondTag9' --data-bi...

To finalise seals send a 'X-Finalise-Seals' header:

...curl -X PUT -H 'X-Finalise-Seals : ' --data-bi...

You will need to send seal tags, if this is a last step:

curl -X POST -H 'X-Finalise-Seals : ' -H 'X-Seal-Tags : SealT...g789' -d '' https://blo....

To delete a blob use DELETE.

curl -X DELETE https://blobs.svnplace.com/joebloggs/DemoBox/HelloWorld.txt

Blobs with api calls

See the blob section of the api.

Blobs with blobcp

TBD: install using pip.

blobcp <options> src* dst

src
The list of source files, or directories.
dst
The destination to copy the source(s) to.

by default src and dst specify local files. To specify blobs prefix with blob:, for example to copy the local file localfile.txt to a Blob:

blobcp locafile.txt blob:joebloggs/DemoBox/blobfile.txt

Both src and dst can also be - to indicate stdin or stdout:

To print out a file:

blobcp blob:joebloggs/DemoBox/blobfile.txt -

To create a tar archive in a blob:

tar -c localfile.txt | blobcp - blob:joeblogs/DemoBox/remotefile.tar

Options

--verbose, -v
verbose mode. Each copy is reported.
--profile, -p:
The profile to use, found in ~/.svnplace/config. Not more than one of --profile and --auth should be given. If none are given, then the default authorisation in ~/.svnplace/config will be used.
blobcp -p joebloggs locafile.txt blob:joebloggs/DemoBox/blobfile.txt
--auth, -a
The authorisation to use, for example, joebloggs:password or joebloggs:k-0123456789abcdef:KeySecret!KeySecret!KeySecret!KeySecret!. Not more than one of --profile and --auth should be given. If none are given, then the default authorisation in ~/.svnplace/config will be used.
blobcp -u joebloggs:password locafile.txt blob:joebloggs/DemoBox/blobfile.txt