can't get object from swift tempurl
Question: I setup SAIO on VirtualBox and want to check how's temp url feature works for
Swift.

here is the object I created call test.txt under container "testCon", you can
see the content and swift list the object

    
    
    swift@swift-VirtualBox:~/bin$ curl -X GET -H 'X-Auth-Token: AUTH_tkba199b23eeec4998b7119d2c9c903216' http://127.0.0.1:8080/v1/AUTH_test/testCon/test.txt
    this is a test
    swift@swift-VirtualBox:~/bin$ swift -A http://127.0.0.1:8080/auth/v1.0 -U test:tester -K testing list testCon
    test.txt
    

I follow the link (<http://ceph.com/docs/master/radosgw/swift/tempurl/>) to
setup temp url key for temp url

    
    
    swift@swift-VirtualBox:~/bin$ curl -X POST -H 'X-Auth-Token: AUTH_tkba199b23eeec4998b7119d2c9c903216' -H 'X-Account-Meta-Temp-URL-Key: secret' http://127.0.0.1:8080/v1/AUTH_test/testCon/test.txt
    <html><h1>Accepted</h1><p>The request is accepted for processing.</p></html>swift@swift-VirtualBox:~/bin$ 
    swift@swift-VirtualBox:~/bin$ swift -A http://127.0.0.1:8080/auth/v1.0 -U test:tester -K testing post -m "Temp-URL-Key:secret" 
    

and follow the python example to generate the temp url links

* * *
    
    
    import hmac
    from hashlib import sha1
    from time import time
    
    method = 'GET'
    
    host = "http://127.0.0.1:8080"
    duration_in_seconds = 300  # Duration for which the url is valid
    expires = int(time() + duration_in_seconds)
    
    path = '/v1/AUTH_test/testCon/test.txt'
    key = 'secret'
    
    hmac_body = '%s\n%s\n%s' % (method, expires, path)
    hmac_body = hmac.new(key, hmac_body, sha1).hexdigest()
    
    sig = hmac.new(key, hmac_body, sha1).hexdigest()
    rest_uri = "{host}{path}?temp_url_sig={sig}&temp_url_expires={expires}".format(
                 host=host, path=path, sig=sig, expires=expires)
    print rest_uri
    

* * *

but when i put the link in cli, it always show: **No such file or directory**

    
    
    swift@swift-VirtualBox:~/bin$ http://127.0.0.1:8080/v1/AUTH_test/testCon/test.txt?temp_url_sig=83fa35362613a18c2ca0b48203ccda61d2229daa&temp_url_expires=1439938672
    [1] 6125
    swift@swift-VirtualBox:~/bin$ -bash: http://127.0.0.1:8080/v1/AUTH_test/testCon/test.txt?temp_url_sig=83fa35362613a18c2ca0b48203ccda61d2229daa: **No such file or directory**
    

can anyone help ? Please provide some suggestions to me ?

Thanks Million !


Answer: You need to browse to the URL generated by the python script. You can do this
either in a web browser or using the curl command from the command line:

    
    
    curl http://127.0.0.1:8080/v1/AUTH_test/testCon/test.txt?temp_url_sig=83fa35362613a18c2ca0b48203ccda61d2229daa&temp_url_expires=1439938672
    

Just placing the url on the command line by itself won't do anything.

