<div dir="ltr">Glad to hear you got object versioning working!<div><br></div><div>You can use `swift stat -v` to see the auth token as well.</div><div><br></div><div>-Clay</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Tue, Sep 17, 2013 at 3:36 AM, Raghavendra Rangrej <span dir="ltr"><<a href="mailto:rrrangrej@yahoo.com" target="_blank">rrrangrej@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
I got hold of generating tokens two ways. For the benefit of future users having similar query (archiving), putting it below.<br>
<br>
1. keystone token-get<br>
<br>
OR<br>
<br>
2. curl -d '{"auth":{"tenantName": "tenantname",<br>
"passwordCredentials":{"username": "nik", "password": "password"}}}' -H<br>
"Content-type: application/json" <a href="http://IP:35357/v2.0/tokens" target="_blank">http://IP:35357/v2.0/tokens</a><br>
<br>
Thanks<br>
Raghavendra<br>
<br>
--------------------------------------------<br>
<div class="im">On Tue, 9/17/13, Raghavendra Rangrej <<a href="mailto:rrrangrej@yahoo.com">rrrangrej@yahoo.com</a>> wrote:<br>
<br>
Subject: Re: [Openstack] Object versioning not working<br>
</div> To: "Clay Gerrard" <<a href="mailto:clay.gerrard@gmail.com">clay.gerrard@gmail.com</a>><br>
Cc: "<a href="mailto:openstack@lists.openstack.org">openstack@lists.openstack.org</a>" <<a href="mailto:openstack@lists.openstack.org">openstack@lists.openstack.org</a>><br>
Date: Tuesday, September 17, 2013, 2:46 PM<br>
<div class="HOEnZb"><div class="h5"><br>
Hi,<br>
<br>
Thanks for the clarification.<br>
<br>
May be a different thread but I have issue generating<br>
tokens.<br>
I am using RDO all in one openstack with swift installed<br>
(with authtoken).<br>
The reason I tried swift CLI was I am not getting how to<br>
generate the auth token to give it in curl commands.<br>
With web search, whatever token I generate, I am getting<br>
unauthorized when I run command like below you gave.<br>
<br>
Any webpage, discussions or document explaining generating<br>
swift token and using it in curl can be helpful as it<br>
has blocked my work.<br>
Current set of openstack documents lack examples for using<br>
authtoken.<br>
<br>
Thanks<br>
Raghavendra<br>
<br>
<br>
<br>
<br>
--------------------------------------------<br>
On Tue, 9/17/13, Clay Gerrard <<a href="mailto:clay.gerrard@gmail.com">clay.gerrard@gmail.com</a>><br>
wrote:<br>
<br>
Subject: Re: [Openstack] Object versioning not working<br>
To: "Raghavendra Rangrej" <<a href="mailto:rrrangrej@yahoo.com">rrrangrej@yahoo.com</a>><br>
Cc: "<a href="mailto:openstack@lists.openstack.org">openstack@lists.openstack.org</a>"<br>
<<a href="mailto:openstack@lists.openstack.org">openstack@lists.openstack.org</a>><br>
Date: Tuesday, September 17, 2013, 2:13 AM<br>
<br>
If you look at the raw API<br>
response from a HEAD on the "testing" container<br>
(maybe with curl) I think you'll see that you've set<br>
the wrong metadata key.<br>
You should set "X-Version-Location:<br>
test_cont" instead of<br>
"X-Container-Meta-X-Version-Location:<br>
test_cont"<br>
<br>
The `-m` option for `swift post` is only for<br>
setting user metadata; unfortunately it doesn't look<br>
like you can set arbitrary headers with `swift<br>
post`:<br>
<a href="https://bugs.launchpad.net/swift/+bug/1226256" target="_blank">https://bugs.launchpad.net/swift/+bug/1226256</a><br>
<br>
<br>
I did this:<br>
curl -H 'x-auth-token:<br>
<your-auth-token-goes-here>' <a href="http://localhost:8080/v1/AUTH_test/testing" target="_blank">http://localhost:8080/v1/AUTH_test/testing</a><br>
-X POST -H 'x-versions-location: test_cont'<br>
<br>
<br>
-Clay<br>
<br>
<br>
On Mon, Sep 16, 2013 at<br>
6:12 AM, Raghavendra Rangrej <<a href="mailto:rrrangrej@yahoo.com">rrrangrej@yahoo.com</a>><br>
wrote:<br>
<br>
Hi,<br>
<br>
<br>
<br>
I am trying swift object versioning using swift CLIs<br>
(using<br>
swift post to change meta data).<br>
<br>
In container-server.conf, I have set the flag<br>
allow_versions<br>
= true.<br>
<br>
<br>
<br>
With CLI, I added meta data as follows:<br>
<br>
<br>
<br>
swift stat testing<br>
<br>
Account: AUTH_1335922166fb4c43a4929f4fba670f3712dw<br>
<br>
Container: testing<br>
<br>
Objects: 3<br>
<br>
Bytes: 157<br>
<br>
Read ACL: -v<br>
<br>
Write ACL:<br>
<br>
Sync To:<br>
<br>
Sync Key:<br>
<br>
Meta X-Versions-Location: test_cont<br>
<br>
Accept-Ranges: bytes<br>
<br>
X-Timestamp: 1379065681.40505<br>
<br>
Content-Type: text/plain; charset=utf-8<br>
<br>
<br>
<br>
<br>
<br>
swift stat test_cont<br>
<br>
Account: AUTH_1335922166fb4c43a4929f4fba670f3712dw<br>
<br>
Container: test_cont<br>
<br>
Objects: 3<br>
<br>
Bytes: 42<br>
<br>
Read ACL:<br>
<br>
Write ACL:<br>
<br>
Sync To:<br>
<br>
Sync Key:<br>
<br>
Accept-Ranges: bytes<br>
<br>
X-Timestamp: 1379066009.84224<br>
<br>
Content-Type: text/plain; charset=utf-8<br>
<br>
<br>
<br>
If I upload a new content of the object in testing<br>
container, I am expecting a version to be created in<br>
test_cont container.<br>
<br>
But it is not the case.<br>
<br>
<br>
<br>
I was expecting once the flag is set and meta data is<br>
changed, old versions should be stored in test_cont dirs<br>
but<br>
it is not the case<br>
<br>
Even swift restart didn't help.<br>
<br>
<br>
<br>
Any idea ? if my expectation is wrong or swift versioning<br>
has issues?<br>
<br>
I am using swift 1.4.0 version<br>
<br>
<br>
<br>
swift --version<br>
<br>
swift 1.4.0<br>
<br>
<br>
<br>
Thanks for your time<br>
<br>
<br>
<br>
Raghavendra<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
<br>
Mailing list: <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack</a><br>
<br>
Post to : <a href="mailto:openstack@lists.openstack.org">openstack@lists.openstack.org</a><br>
<br>
Unsubscribe : <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack</a><br>
<br>
<br>
<br>
<br>
<br>
</div></div></blockquote></div><br></div>