Elements runtime reference / Tenant GCS files

signGcsFile

Generate a short-lived signed URL for a tenant-scoped GCS object.

Signatuur

signGcsFile(path, bucket=None, prefix=None, ttlSeconds=None, method='GET', contentType=None)

Doel

Generate a short-lived signed URL for a tenant-scoped GCS object.

Aliases and imports

  • sign_gcs_file
  • gcs.sign
  • gcs.sign_file
  • gcs.signed_url

Payloadformaat

Use these fields as the Python call arguments or keyword payload for this helper.

{
  "path": "exports/report.json",
  "ttlSeconds": 900,
  "method": "GET"
}
FieldDescription
pathRelative path, filestore/{tenantId}-prefixed object path, or gs:// URI inside the current tenant filestore folder.
ttlSecondsSigned URL TTL. Defaults to the worker helper default and is capped by the worker.
methodHTTP method, usually GET for downloads or PUT for upload-style access.
contentTypeOptional content type required for PUT/POST signed URLs.

Return payload

{
  "signedUrl": "https://storage.googleapis.com/...",
  "url": "https://storage.googleapis.com/...",
  "downloadUrl": "https://storage.googleapis.com/...",
  "expiresAt": "2026-07-06T12:15:00Z",
  "method": "GET",
  "gcsUri": "gs://dashview-cache/filestore/tenant/exports/report.json"
}

Voorbeeld

def run():
    signed = gcs.sign("exports/report.json", ttlSeconds=900)
    return {"downloadUrl": signed["signedUrl"]}

Scope-notities