tempurl

Prev Next

Available in Classic and VPC

Create a temporary URL that provides access to the object.

Syntax

The tempurl syntax is as follows:

swift tempurl \
    <method> \
    <time> \
    <path> \
    <key> \
    [--absolute] \
    [--prefix-based] \
    [--iso8601] \
    [--ip-range <ip-range>] \
    [--digest <sha1|sha256|sha512>]

Options

This section describes the options available when running tempurl.

Required options

The following options are required for tempurl.

Options Type Required Description
<method> String Required HTTP method allowed for temporary URLs
  • GET | HEAD | PUT | POST | DELETE
<time> String Required Expiration time of the temporary URL
  • Integer in seconds (e.g., 3600).
  • s m h d suffixes appended to a number (e.g., 24h).
  • ISO 8601-formatted timestamp (e.g., 2026-08-19T19:20:30Z).
  • When entering --absolute, the integer is interpreted as the Unix timestamp at the expiration time.
<path> String Required Full path to the object or storage URL
  • Example: /v1/AUTH_{project_id}/{container}/{object}
<key> String Required Temporary URL secret key configured in the cluster
  • Configure it via the post command (e.g., swift post -m "Temp-URL-Key:{key}").
  • See post.

Optional options

These are the optional options for tempurl. Options that are not specified will use their default values.

Options Type Required Description
--absolute Boolean Optional Interprets <time> as a Unix timestamp.
  • <time> is ignored if it is in ISO 8601 format.
--prefix-based Boolean Optional Creates a prefix-based temporary URL.
--iso8601 Boolean Optional Includes an ISO 8601 UTC timestamp in the temporary URL instead of a Unix timestamp.
--ip-range String Optional IP addresses or IP ranges allowed to use the temporary URL
--digest String Optional Digest algorithm to use
  • sha1 | sha256 | sha512

Common options

For information about the options common to all swift subcommands, see Archive Storage options.

Examples

When you create a temporary URL, a path containing the signature and expiration date/time is output. Prepend the storage URL verified using the auth command to the output path.

Command

The command example is as follows:

swift tempurl GET 3600 \
    /v1/AUTH_a1b2c3d4e5f64a7b8c9d0e1f2a3b4c5d/test-container-01/sample.txt \
    {key}

Output

The output example is as follows:

/v1/AUTH_a1b2c3d4e5f64a7b8c9d0e1f2a3b4c5d/test-container-01/sample.txt?temp_url_sig=<signature-redacted>&temp_url_expires=1787108031