copyright | lastupdated | ||
---|---|---|---|
|
2017-02-23 |
{:new_window: target="_blank"} {:shortdesc: .shortdesc} {:codeblock: .codeblock} {:screen: .screen} {:pre: .pre}
A temporary URL is a long, difficult-to-guess URL that can be used for a specified period of time to download objects without requiring further authentication or giving full access to the storage account. {: shortdesc}
- Identify your authentication information by printing your account information with the following command:
swift stat
{: pre}
Note: Take note of the full string behind Account, including AUTH_
.
- Set a secret key. Choose a long, random, and hard to guess string. To set the key, run the following command:
swift post -m "Temp-URL-Key:<key>"
{: pre}
- Verify that the
Temp-URL-Key
was set successfully by running the following command.
swift stat
{: pre}
- Create a temporary URL by running the following command:
swift tempurl GET <seconds> <path> <key>
{: pre}
The following table explains the positional arguments that the Swift tempurl
command takes.
Argument | Description |
---|---|
method | GET to allow download. PUT to allow upload. |
seconds | Time that the temporary URL is available, expressed in seconds. |
path | The full path of the object expressed as /v1/auth_account/container_name/object_name . |
key | The secret key that you set in step 2. |
- Optional: Append the returned URL to your cluster name to get a full URL. You can then use the full URL to download objects with any compatible HTTP client such as cURL, wget, or Firefox.