Skip to content

Latest commit

 

History

History
76 lines (59 loc) · 2.05 KB

os_tempurl.md

File metadata and controls

76 lines (59 loc) · 2.05 KB
copyright lastupdated
years
2014, 2017
2017-02-23

{:new_window: target="_blank"} {:shortdesc: .shortdesc} {:codeblock: .codeblock} {:screen: .screen} {:pre: .pre}

Creating a temporary URL {: #create-temporary-url}

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}

  1. 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_.

  1. 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}

  1. Verify that the Temp-URL-Key was set successfully by running the following command.
swift stat

{: pre}

  1. 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.

Table 1. Temporary URL positional arguments
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.
  1. 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.