This call lets you perform a bulk import of files from your volume (either Amazon Web Services or Google Cloud Storage) into your project on the Platform.
You can use this call to either import files to a specific folder or a project but you can also use it to import a folder and its files into another destination folder while preserving folder structure (see below). One call can contain up to 100 items.
Learn more about using the Volumes API for Amazon S3 and for Google Cloud Storage.
If you are using Seven Bridges Platform EU, please use the following endpoint:
https://eu-api.sbgenomics.com/v2/bulk/storage/imports/create
Example request body
{
"items": [
{
"source": {
"volume": "rfranklin/my-volume",
"location": "chimeras.html.gz"
},
"destination": {
"project": "rfranklin/my-project"
}
},
{
"source": {
"volume": "rfranklin/my-volume",
"location": "my-folder/"
},
"destination": {
"project":"rfranklin/my-project"
},
"autorename": true,
"preserve_folder_structure": true
},
{
"source": {
"volume": "rfranklin/my-volume",
"location": "my-volume-folder/"
},
"destination": {
"name": "new-folder-name",
"parent": "567890abc1e5339df0414123"
},
"autorename": true,
"preserve_folder_structure": true
}
]
}
Response
Response body
Key | Data type | Description |
---|---|---|
id | string | ID of this import job. |
state | string | The state of this import job. Possible values are:PENDING : the import is queued;RUNNING : the import is running;COMPLETED : the import has completed successfully;FAILED : the import has failed. |
source | object | Import source, as passed when this job was started by the call to start an import job. |
destination | object | Import destination, as passed when this job was start an import job. |
result | object | File object that was imported. |
error | object | In case of error in the import job, standard API error is returned here. |
Import a volume folder into a specific folder
To import a volume folder into a specific folder in one of your projects, use the source
parameter to specify the volume and the folder you are importing from, as well as the ID of the target folder in your project using the parent
parameter. Use the API call for listing files to obtain the folder ID of the desired parent folder.
The folder structure is preserved by setting the preserve_folder_structure
parameter to true.
The name
parameter can be used to rename the imported folder within the destination folder. The following parameters can be used to determine the behavior in case a folder with the same name already exists (if omitted, the files that exist in the destination folder will be preserved):
- autorename - the files that are being imported will be automatically renamed
- overwrite - the files that already exist in your project on the Platform will be overwritten
{
"items": [
{
"source": {
"volume": "rfranklin/my-volume",
"location": "my-volume-folder/"
},
"destination": {
"name": "new-folder-name",
"parent": "567890abc1e5339df0414123"
},
"autorename": true,
"preserve_folder_structure": true
}
}
]
}