Start a bulk import job

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

See a list of Seven Bridges Platform-specific response codes that may be contained in the body of the response.

Response body

KeyData typeDescription
idstringID of this import job.
statestringThe 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.
sourceobjectImport source, as passed when this job was started by the call to start an import job.
destinationobjectImport destination, as passed when this job was start an import job.
resultobjectFile object that was imported.
errorobjectIn 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
        }
        }
    ]
}
Language