Doel
Read a tenant-scoped GCS file through data-worker-agent.
Elements runtime reference / Tenant GCS files
downloadGcsFileRead a tenant-scoped GCS file through data-worker-agent.
downloadGcsFile(path, bucket=None, prefix=None, encoding='utf-8', asBytes=False, maxBytes=None, withMetadata=False)
Read a tenant-scoped GCS file through data-worker-agent.
download_gcs_filegcs.downloadgcs.download_fileUse these fields as the Python call arguments or keyword payload for this helper.
{
"path": "exports/report.json",
"withMetadata": true
}
| Field | Description |
|---|---|
path | Relative path, filestore/{tenantId}-prefixed object path, or gs:// URI inside the current tenant filestore folder. |
bucket | Optional bucket override; must match the configured file artifact/output bucket. |
prefix | Optional extra prefix under filestore/{tenantId}/ when path is relative. |
encoding | Text encoding used when asBytes is false. |
asBytes | When true, return metadata with base64 data instead of decoded text. |
maxBytes | Optional read cap bounded by DATA_WORKER_FILE_ARTIFACT_MAX_BYTES. |
withMetadata | When true, return the metadata envelope even for text reads. |
{
"gcsUri": "gs://dashview-cache/filestore/tenant/exports/report.json",
"contentType": "application/json",
"encoding": "utf-8",
"text": "{\"status\":\"ready\"}",
"size": 18
}
def run():
report = gcs.download("exports/report.json", withMetadata=True)
return {"report": report["text"]}