Skip to content

Instantly share code, notes, and snippets.

@larssono
Created June 23, 2015 17:15
Show Gist options
  • Save larssono/1c2b9acfc2fba25a96fb to your computer and use it in GitHub Desktop.
Save larssono/1c2b9acfc2fba25a96fb to your computer and use it in GitHub Desktop.
# Make S3 bucket the default storage location for project you set up. Lets assume that this project has Id syn123
#In R run:
library(synapseClient)
synapseLogin()
# Set up a storage location for this bucket in Synapse. Only need to do this once per bucket.
AWSbucketName = "your-bucket-name-here"
storageLocation <- synRestPOST("/storageLocation", list(
concreteType="org.sagebionetworks.repo.model.project.ExternalS3StorageLocationSetting",
uploadType="S3",
bucket=AWSbucketName,
baseKey=""))
##Add this as the default storage location for the new project at syn123
synRestPOST('/projectSettings', list(
"concreteType": "org.sagebionetworks.repo.model.project.UploadDestinationListSetting",
"settingsType": "upload",
"projectId": "syn123",
"locations" = [storageLocationt['storageLocationId']])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment