Elements runtime reference / Tenant GCS files

uploadGcsFile

Upload a tenant-scoped file from an Element into the configured GCS file artifact/output bucket.

Signatuur

uploadGcsFile(path, content=None, data=None, dataBase64=None, rows=None, format=None, bucket=None, prefix=None, contentType=None, encoding=None, overwrite=False, metadata=None, signedUrl=False, ttlSeconds=None, method=None)

Doel

Upload a tenant-scoped file from an Element into the configured GCS file artifact/output bucket.

Aliases and imports

  • upload_gcs_file
  • gcs.upload
  • gcs.upload_file

Payloadformaat

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

{
  "path": "exports/report.json",
  "data": {
    "status": "ready"
  },
  "format": "json",
  "overwrite": true,
  "signedUrl": true,
  "ttlSeconds": 900
}
FieldDescription
pathRelative file path under the current tenant filestore folder, or a gs:// URI already inside that folder.
content/data/dataBase64/rowsPayload to upload. Rows can be serialized as json, ndjson, csv, or parquet using format.
formatOptional output format. Inferred from path when omitted.
bucketOptional bucket override; must match the worker configured file artifact/output bucket.
prefixOptional extra prefix under filestore/{tenantId}/.
overwriteWhen false, upload fails if the object exists.
metadataOptional object metadata. Values are stringified by the worker.
signedUrl/ttlSeconds/methodWhen signedUrl is true, include a short-lived signed URL in the response.

Return payload

{
  "uri": "gs://dashview-cache/filestore/tenant/exports/report.json",
  "gcsUri": "gs://dashview-cache/filestore/tenant/exports/report.json",
  "relativePath": "exports/report.json",
  "contentType": "application/json",
  "size": 18,
  "signedUrl": "https://storage.googleapis.com/...",
  "expiresAt": "2026-07-06T12:15:00Z"
}

Voorbeeld

def run():
    ref = gcs.upload(
        "exports/report.json",
        data={"status": "ready"},
        format="json",
        overwrite=True,
        signedUrl=True,
    )
    return {"gcsUri": ref["gcsUri"], "downloadUrl": ref["signedUrl"]}

Scope-notities