[Openstack] [OpenStack] [Swift] How to use s3curl or s3cmd with Swift3?

Alexandr Porunov alexandr.porunov at gmail.com
Thu Oct 13 18:45:19 UTC 2016


I did it.

First I need to create ec2 credentials:
openstack ec2 credentials create

Then I had to change "my @endpoints" parameter in s3curl.pl as following:
my @endpoints = ( 'proxy');

And then just use my credentials with s3curl.pl

For example. For containers list:
./s3curl.pl --id access_key --key secret_key http://proxy:8080

For objects list in a container:
./s3curl.pl --id access_key --key secret_key http://proxy:8080/my_container

For stream an object:
./s3curl.pl --id access_key --key secret_key
http://proxy:8080/my_container/my_object

Sincerely,
Alexandr

On Thu, Oct 13, 2016 at 12:42 PM, Alexandr Porunov <
alexandr.porunov at gmail.com> wrote:

> To get token I use the next command:
>
> curl -i \
>   -H "Content-Type: application/json" \
>   -d '
> { "auth": {
>     "identity": {
>       "methods": ["password"],
>       "password": {
>         "user": {
>           "name": "swift",
>           "domain": { "name": "default" },
>           "password": "swift"
>         }
>       }
>     },
>     "scope": {
>       "project": {
>         "name": "service",
>         "domain": { "name": "default" }
>       }
>     }
>   }
> }' \
>   http://keystone:5000/v3/auth/tokens ; echo
>
> Here is the latest output:
>
> HTTP/1.1 201 Created
> Date: Thu, 13 Oct 2016 12:40:53 GMT
> Server: Apache/2.4.6 (CentOS) mod_wsgi/3.4 Python/2.7.5
> X-Subject-Token: 21d9ea93e9324fedb8853c94e6698d79
> Vary: X-Auth-Token
> x-openstack-request-id: req-eaf0c587-fcaa-4294-bee6-507385eea1e8
> Content-Length: 1715
> Content-Type: application/json
>
> {"token": {"methods": ["password"], "roles": [{"id": "
> 908072b0551448a29793277b4ad71688", "name": "admin"}], "expires_at":
> "2016-10-13T13:40:54.107598Z", "project": {"domain": {"id": "
> 839eff379a694db0b4c69716b7ee7c32", "name": "default"}, "id": "
> 3f842db875cc48b99d7ff246c27a2e6a", "name": "service"}, "catalog":
> [{"endpoints": [{"region_id": "RegionOne", "url": "
> http://proxy:8080/v1/AUTH_3f842db875cc48b99d7ff246c27a2e6a", "region":
> "RegionOne", "interface": "internal", "id": "
> 19fe381617d84ca7a7953e1dfd89f181"}, {"region_id": "RegionOne", "url": "
> http://proxy:8080/v1", "region": "RegionOne", "interface": "admin", "id":
> "6ff73960ff4249e7a3f5d9fa7cbe90e0"}, {"region_id": "RegionOne", "url": "
> http://proxy:8080/v1/AUTH_3f842db875cc48b99d7ff246c27a2e6a", "region":
> "RegionOne", "interface": "public", "id": "ec5e71ac89fc4a66a026ad96d8c0df49"}],
> "type": "object-store", "id": "83436928701349379c7e643954acbb8d", "name":
> "swift"}, {"endpoints": [{"region_id": "USA_east_1", "url": "
> http://keystone:5000/v3", "region": "USA_east_1", "interface": "public",
> "id": "2b552dffdf564d7dab281d6676a5e86e"}, {"region_id": "USA_east_1",
> "url": "http://keystone:5000/v3", "region": "USA_east_1", "interface":
> "internal", "id": "8a73678a836a47bbb16a5df7e41576df"}, {"region_id":
> "USA_east_1", "url": "http://keystone:35357/v3", "region": "USA_east_1",
> "interface": "admin", "id": "964dbc7a4920416588bc754bfed583b7"}], "type":
> "identity", "id": "77366d6be47a46ff94d56e1436fab2aa", "name":
> "keystone"}], "user": {"domain": {"id": "839eff379a694db0b4c69716b7ee7c32",
> "name": "default"}, "id": "1fb1511494744101b9cfab7b68d9098e", "name":
> "swift"}, "audit_ids": ["lGLvUwAXQo2f2L6WNxvl-Q"], "issued_at":
> "2016-10-13T12:40:54.107633Z"}}
>
>
> On Thu, Oct 13, 2016 at 12:40 PM, Alexandr Porunov <
> alexandr.porunov at gmail.com> wrote:
>
>> Thank you. You were right.
>>
>> Now s3curl works but I don't know how to use it.. I try to check if
>> swift3 is working with the next command:
>>   ./s3curl.pl --id 'swift' -key '384c48d6a26244aebcfa26cff4567bc0' -get
>> -s -v http://proxy:8080/v1/AUTH_3f842db875cc48b99d7ff246c27a2e6a
>>
>> and
>>
>>   ./s3curl.pl --id 'swift' -key 'swift' -get -s -v
>> http://proxy:8080/v1/AUTH_3f842db875cc48b99d7ff246c27a2e6a
>>
>> in both cases I get the same error:
>> <?xml version='1.0' encoding='UTF-8'?>
>> <Error><Code>InvalidBucketName</Code><Message>The specified bucket is
>> not valid.</Message><RequestId>tx75447f12c8434120b20cd-0057ff7ff
>> e</RequestId><BucketName>v1</BucketName></Error>
>>
>> Do you know how to resolve it?
>>
>> On Thu, Oct 13, 2016 at 12:10 PM, Turbo Fredriksson <turbo at bayour.com>
>> wrote:
>>
>>> On Oct 13, 2016, at 9:29 AM, Alexandr Porunov wrote:
>>>
>>> > Can't locate Digest/HMAC_SHA1.pm in @INC (@INC contains:
>>>
>>> You need to install the "libdigest-hmac-perl" package..
>>> --
>>> Try not. Do. Or do not. There is no try!
>>> - Yoda
>>>
>>>
>>> _______________________________________________
>>> Mailing list: http://lists.openstack.org/cgi
>>> -bin/mailman/listinfo/openstack
>>> Post to     : openstack at lists.openstack.org
>>> Unsubscribe : http://lists.openstack.org/cgi
>>> -bin/mailman/listinfo/openstack
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20161013/bb3a9c51/attachment.html>


More information about the Openstack mailing list