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

2016-10-13 Thread Alexandr Porunov
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.poru...@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.poru...@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:
>> 
>> InvalidBucketNameThe specified bucket is
>> not valid.tx75447f12c8434120b20cd-0057ff7ff
>> ev1
>>
>> Do you know how to resolve it?
>>
>> On Thu, Oct 13, 2016 at 12:10 PM, Turbo Fredriksson 
>> 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@lists.openstack.org
>>> Unsubscribe : http://lists.openstack.org/cgi
>>> -bin/mailman/listinfo/openstack
>>>
>>
>>
>
___
Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to : openstack@lists.openstack.org
Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack


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

2016-10-13 Thread Alexandr Porunov
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:

InvalidBucketNameThe specified bucket is not
valid.tx75447f12c8434120b20cd-0057ff7ffev1

Do you know how to resolve it?

On Thu, Oct 13, 2016 at 12:10 PM, Turbo Fredriksson 
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@lists.openstack.org
> Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/
> openstack
>
___
Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to : openstack@lists.openstack.org
Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack


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

2016-10-13 Thread Alexandr Porunov
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.poru...@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:
> 
> InvalidBucketNameThe specified bucket is not
> valid.tx75447f12c8434120b20cd-0057ff7ffe<
> BucketName>v1
>
> Do you know how to resolve it?
>
> On Thu, Oct 13, 2016 at 12:10 PM, Turbo Fredriksson 
> 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@lists.openstack.org
>> Unsubscribe : http://lists.openstack.org/cgi
>> -bin/mailman/listinfo/openstack
>>
>
>
___
Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to : openstack@lists.openstack.org
Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack


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

2016-10-13 Thread Turbo Fredriksson
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@lists.openstack.org
Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack


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

2016-10-13 Thread Kota TSUYUZAKI
Hello again,

I'm not familier with s3curl in detail though,

> ./s3curl.pl - 'swift' -key '3d8b70ad194a4cf6857e59ec638d' -get - -s -v
> http://proxy:8080/v1/AUTH_3f842db875cc48b99d7ff246c27a2e6a
>

could you try:

./s3curl.pl - 'swift' -key 'swift' -get - -s -v http://proxy:8080/

IIRC, secret_key is not a swift token but a password you set in your keystone 
and swift3 doesn't require Swift url so you can request to the host directly.

Regards,
Kota


(2016/10/13 17:29), Alexandr Porunov wrote:
> Hello,
> 
> I try to use s3curl to test swift3 but I miss something.
> 
> Here is the command which I use:
> ./s3curl.pl - 'swift' -key '3d8b70ad194a4cf6857e59ec638d' -get - -s -v
> http://proxy:8080/v1/AUTH_3f842db875cc48b99d7ff246c27a2e6a
> 
> It shows:
> Can't locate Digest/HMAC_SHA1.pm in @INC (@INC contains:
> /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl
> /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ./
> s3curl.pl line 20.
> BEGIN failed--compilation aborted at ./s3curl.pl line 20.
> 
> I am not sure that I write the command correctly.
> 
> *swift* - is the account
> *3d8b70ad194a4cf6857e59ec638d* - is the X-Subject-Token I have got in
> the header with this 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
> 
> *http://proxy:8080/v1/AUTH_3f842db875cc48b99d7ff246c27a2e6a
> * - is the
> public endpoint
> 
> Am I doing correctly?
> 
> Why doesn't it work?
> 
> Sincerely,
> Alexandr
> 
> 
> 
> ___
> Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
> Post to : openstack@lists.openstack.org
> Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
> 


-- 
--
Kota Tsuyuzaki(露﨑 浩太)  
NTT Software Innovation Center
Cloud Solution Project
Phone  0422-59-2837
Fax0422-59-2965
---



___
Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to : openstack@lists.openstack.org
Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack