Access Files in BucketFS

You can access the buckets and the files in a bucket by using an HTTPS client.

HTTP Access to BucketFS

From outside the cluster, it is possible to access the buckets and the files contained in it using an HTTPS clients such as curl. You only have to use one of the database servers' IP address, the specified port and the bucket name, and adjust your network configuration to allow access to the host and port. The corresponding path for a bucket can be found in EXAoperation in the overview of a bucket.

To access buckets that are not publicly readable, you must have the user's r - read user and w- write user passwords configured during BucketFS creation.

List Buckets

Using curl, you can list all the existing buckets in the database. The following example shows you how to list existing buckets. The parameters in the example are the read password (readpw) for the user, the database server IP address (192.168.6.75), and the port number (1234) for BucketFS.

$> curl https://r:readpw@192.168.6.75:1234
default
bucket1

Add and View Files to Buckets

You can add files into BucketFS using the PUT option. The following examples shows how to upload the files - file1 and tar1.tgz into the bucket - bucket1, and display the list of contained files in this bucket. The relevant parameters for our example are the port of the BucketFS (1234), the name of the bucket (bucket1) and the passwords (readpw and writepw).

curl -k -X PUT -T file1 https://w:writepw@192.168.6.75:1234/bucket1/file1
curl -k -X PUT -T tar1.tgz \
https://w:writepw@192.168.6.75:1234/bucket1/tar1.tgz
curl -k https://r:readpw@192.168.6.75:1234/bucket1

file1
tar1.tgz

Additionally, you can also use the GET option to view the contents of the files available in a bucket.

curl -k -X GET https://w:writepw@192.168.6.75:1234/bucket1/file1

Delete Files from Buckets

You can delete files that are no longer needed by using the DELETE option. The following example shows how to delete file1 from the bucket. The relevant parameters for our example are the port of the BucketFS (1234), the name of the bucket (bucket1) and the passwords (writepw).

curl -X DELETE https://w:writepw@192.168.6.75:1234/bucket1/file1