Skip to main content

tcb storage objects sign

Generate a temporary download URL for an object; add --upload to switch to an upload URL.

v3.4.0+

PG mode storage commands have been available since @cloudbase/cli@3.4.0.

Usage​

# Download signature
tcb storage objects sign <keys...> -b <bucketId> [--expires-in <seconds>] [--json]

# Upload signature
tcb storage objects sign <key> --upload -b <bucketId> [--upsert] [--json]

Parameters​

ParameterRequiredDescriptionDefault
<keys...>Yes1 to 500 in download mode; exactly 1 in upload mode—
-b, --bucket <bucketId>YesBucket ID—
--uploadNoSwitch to upload signature modefalse
--expires-in <seconds>NoExpiry in seconds, at least 1, download mode only600
--upsertNoAllow overwriting, equivalent to x-upsert: true, upload mode onlyfalse
--jsonNoDownload mode outputs [{ path, signedURL, error }]; upload mode outputs { url, token }—

Mutual exclusion rules:

  • --upload and --expires-in cannot be combined.
  • --upsert is rejected in download mode.
  • --upload signs exactly one key per call.

Examples​

tcb storage objects sign test/hello.txt -b my-bucket --expires-in 3600
tcb storage objects sign test/hello.txt -b my-bucket --upload --upsert