Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swift: Cannot set expiry date for a container #57

Open
AJNOURI opened this issue Jan 21, 2017 · 1 comment
Open

Swift: Cannot set expiry date for a container #57

AJNOURI opened this issue Jan 21, 2017 · 1 comment

Comments

@AJNOURI
Copy link
Owner

AJNOURI commented Jan 21, 2017

echo "data" > object1.txt
swift upload container1 object1.txt
swift post container1 -r .r:*,.rlinstings

selection_717

Date now:

date

Sat Jan 21 14:07:45 UTC 2017

date in 3 min

date -d "Sat Jan 21 14:10:00 UTC 2017" +%s
1485007800

Container inf.

swift stat -v container1

         URL: http://146.20.105.187:8080/v1/AUTH_94d6b69b25f74041a5c413513612c8bd/container1
  Auth Token: 540238bc72284c74a051df53089583b6
     Account: AUTH_94d6b69b25f74041a5c413513612c8bd
   Container: container1
     Objects: 1
       Bytes: 5
    Read ACL: .r:*,.rlistings
   Write ACL:
     Sync To:
    Sync Key:

Accept-Ranges: bytes
X-Trans-Id: tx04287daafd6045d8a7ba7-0058836b67
X-Storage-Policy: Policy-0
Last-Modified: Sat, 21 Jan 2017 13:54:34 GMT
X-Timestamp: 1485005672.89799
Content-Type: text/plain; charset=utf-8

Set expiry date:
curl -X PUT -H "X-Auth-Token:540238bc72284c74a051df53089583b6" -H "X-Delete-At:1485007800" http://146.20.105.187:8080/v1/AUTH_94d6b69b25f74041a5c413513612c8bd/container1

<html><h1>Accepted</h1><p>The request is accepted for processing.</p></html>

The time already passed and the container is still accessible publically:
selection_718


Tried using swift command :

#now
date

Sat Jan 21 14:13:49 UTC 2017

#in 5 min
date -d "Sat Jan 21 14:19:00 UTC 2017" +%s

1485008340

swift post container1 object1.txt -H X-Delete-At:1485008340

But the container is still accessible

selection_719

@AJNOURI
Copy link
Owner Author

AJNOURI commented Jan 27, 2017

With curl REST API query, I should have used POST request not PUT
curl -X PUT
not
curl -X POST

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant