s3curl is a perl client for S3 object storage management. You can download it via git (i.e. git clone https://github.com/UKCloud/s3curl.git).

The script requires the package libdigest-hmac-perl (for Debian) or perl-Digest-HMAC (for CentOS).

First, create the file ~/.s3curl containing your S3 (Openstack EC2) credentials under a profile named for instance SwiftCloud, i.e.:


%awsSecretAccessKeys = (

    SwiftCloud => {

        id => ‘<user_id>',

        key => ‘<secret_key>',

    },

);


Set permissions on ~/.s3curl to 600 or the s3curl.pl script won't be able to run. Then open the s3curl.pl file and go to the lines:


# begin customizing here

my @endpoints = ('<api_endpoint>', 's3.amazonaws.com', ...


Under this line you have to add the Cloud@CNAF API interface endpoint:


#begin customizing here

my @endpoints = ('tb-cloud-api-int.cr.cnaf.infn.it', 's3.amazonaws.com', ...


and save the s3curl.pl file.

It is highly recommended to install the package libxml2-utils (for Debian) or libxml2 (for CentOS), in order to make s3curl's xml output much more human readable.

Finally, you should be able to manage your buckets and objects, e.g.:


fornari@pc-fornari:~/test_s3/s3curl$ xmllint --format <(perl s3curl.pl --id SwiftCloud -- https://tb-cloud-api-int.cr.cnaf.infn.it:8080 2>/dev/null)

<?xml version="1.0" encoding="UTF-8"?>

<ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">

  <Owner>

    <ID>admin:ffornari</ID>

    <DisplayName>admin:ffornari</DisplayName>

  </Owner>

  <Buckets>

    <Bucket>

      <Name>pippo</Name>

      <CreationDate>2009-02-03T16:45:09.000Z</CreationDate>

    </Bucket>

  </Buckets>

</ListAllMyBucketsResult>

fornari@pc-fornari:~/test_s3/s3curl$ 

  • No labels