AJNOURI / COA

Openstack Foundation Openstack Certified Administrator exam Preparation
MIT License
45 stars 37 forks source link

Swift: Cannot set expiry date for a container #57

Open AJNOURI opened 7 years ago

AJNOURI commented 7 years ago
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 commented 7 years ago

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