From 94027f44ba70f0f15cb5baf15447e7eaa2f668df Mon Sep 17 00:00:00 2001 From: root Date: Wed, 20 Mar 2024 23:12:37 +0000 Subject: [PATCH] update example scripts for generating Synapse file handles from external S3 bucket --- _articles/custom_storage_location.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_articles/custom_storage_location.md b/_articles/custom_storage_location.md index 46d20faa..b6c05476 100644 --- a/_articles/custom_storage_location.md +++ b/_articles/custom_storage_location.md @@ -257,7 +257,7 @@ fileHandle = {'concreteType': 'org.sagebionetworks.repo.model.file.S3FileHandle' 'storageLocationId': destination['storageLocationId']} fileHandle = syn.restPOST('/externalFileHandle/s3', json.dumps(fileHandle), endpoint=syn.fileHandleEndpoint) -f = synapseclient.File(parentId=PROJECT, dataFileHandleId = fileHandle['id']) +f = synapseclient.File(parentId=PROJECT, dataFileHandleId = fileHandle['id'], name=fileHandle['fileName']) f = syn.store(f) ``` @@ -276,7 +276,7 @@ fileHandle <- list(concreteType='org.sagebionetworks.repo.model.file.S3FileHandl key ='s3ObjectKey') fileHandle <- synRestPOST('/externalFileHandle/s3', body=toJSON(fileHandle), endpoint = 'https://file-prod.prod.sagebase.org/file/v1') -f <- File(dataFileHandleId=fileHandle$id, parentId=projectId) +f <- File(dataFileHandleId=fileHandle$id, name=fileHandle$fileName, parentId=projectId) f <- synStore(f) ```