Start a bulk export job

Bulk export files from your project on the Platform into your volume on either Amazon Web Services or Google Cloud Storage. One call can contain up to 100 items.

Files selected for export must not be public files or aliases. Aliases are objects stored in your cloud storage bucket which have been made available on the Platform.

The volume you are exporting to must be configured for read-write access. To do this, set the access_mode parameter to RW when creating or modifying a volume.

Essentially, the call writes to your cloud storage bucket on Amazon Web Services or Google Cloud Storage via the volume. If this call is successful, the original project files will become aliases to the newly exported objects on the volume. Source files will be deleted from the Platform and, if no more copies of the files exist, they will no longer count towards your total storage price on the Platform. In summary, once you export files from the Platform to a volume, they are no longer part of the storage on the Platform and cannot be exported again.

Learn more about using the Volumes API for for Amazon S3 and for Google Cloud Storage.

Request

https://api.sb.biodatacatalyst.nhlbi.nih.gov/v2/bulk/storage/exports/create

Example request

POST v2/bulk/storage/exports/create
Host: api.sb.biodatacatalyst.nhlbi.nih.gov
X-SBG-Auth-Token: 3259c50e1ac5426ea8f1273259740f75
curl -X POST \
  https://api.sb.biodatacatalyst.nhlbi.nih.gov/v2/bulk/storage/exports/create \
  -H 'Content-Type: application/json' \
  -H 'X-SBG-Auth-Token: b04aa2a2e98348a1a3a75ca677ea7fd7' \
  -d '{
    "items": [
        {
              "source": {
                "file": "5abce8051c948ec3c0ce2b7c"
              },
              "destination": {
                "volume": "rfranklin/output",
                "location": "output.vcf"
              },
              "overwrite": true,
              "properties": {
              "sse_algorithm": "AES256"
            }
        },
        {
              "source": {
                "file": "5abce8191c948ec3c0ce2b7f"
              },
              "destination": {
                "volume": "rfranklin/output",
                "location": "output.vcf"
              },
              "overwrite": false,
              "properties": {
              "sse_algorithm": "AES256"
            }
        }
         
    ]
}
'

Header Fields

NameDescription
X-SBG-Auth-Token
required
Your authentication token.
Content-Type
required
application/json

Query parameters - Advance Access

The following parameter is Advance Access. This means that, while it is fully operational, it is subject to change. Learn more about this feature below.

KeyData typeDescription
copy_onlyBooleanIf set to true, the file will be copied to a volume but the source file will remain on the Platform.

Request body

For every item in the request body, you should enter the list of key-value pairs described in the table below. One API call can contain up to 100 items.

KeyData typeDescription
source
required
BooleanIf set to true, the file will be copied to a volume but the source file will remain on the Platform.
file
required
StringThe ID of the file for export.
destination
required
ObjectThis object describes the destination to which the file will be exported.
volumeStringThe ID of the volume to which the files will be exported.
location
required
StringVolume-specific location to which the files will be exported.
This location should be recognizable to the underlying cloud service as a valid key or path to the new files.

Please note that if this volume has been configured with a prefix parameter, the value of prefix will be prepended to location before attempting to create files on the volume.
propertiesObjectService-specific properties of the export. These values override the defaults from the volume.
sse_algorithmStringS3 server-side encryption to use when exporting to this bucket.

Supported values:

AES256 (SSE-S3 encryption)
'aws:kms *null` (no server-side encryption).
default:AES256
sse_aws_kms_key_id
applies to type:s3
StringIf AWS KMS encryption is used, this should be set to the required KMS key. If not set and aws:kms is set as sse_algorithm, default KMS key is used.
aws_canned_aclStringIf AWS KMS encryption is used, this should be set to the required KMS key. If not set and aws:kms is set as sse_algorithm, default KMS key is used.
overwriteBooleanIf this is set to true and a named file exists in the project where the alias is about to be created, the existing file will be deleted.

default:false

Example request (normal)

POST /v2/bulk/storage/exports/create HTTP/1.1  
Host: api.sb.biodatacatalyst.nhlbi.nih.gov
X-SBG-Auth-Token: 3259c50e1ac5426ea8f1273259740f74
Content-Type: application/json
{
    "items": [
        {
              "source": {
                "file": "5abce8051c948ec3c0ce2b7c"
              },
              "destination": {
                "volume": "rfranklin/output",
                "location": "output.vcf"
              },
              "overwrite": true,
              "properties": {
              "sse_algorithm": "AES256"
            }
        },
        {
              "source": {
                "file": "5abce8191c948ec3c0ce2b7f"
              },
              "destination": {
                "volume": "rfranklin/output",
                "location": "output.vcf"
              },
              "overwrite": false,
              "properties": {
              "sse_algorithm": "AES256"
            }
        }
         
    ]
}

Example request (advance access - copy file only)

POST /v2/bulk/storage/exports?copy_only=true HTTP/1.1  
Host: api.sb.biodatacatalyst.nhlbi.nih.gov
X-SBG-Auth-Token: 3259c50e1ac5426ea8f1273259740f74
Content-Type: application/json
{
    "items": [
        {
              "source": {
                "file": "5abce8051c948ec3c0ce2b7c"
              },
              "destination": {
                "volume": "rfranklin/output",
                "location": "output.vcf"
              },
              "overwrite": true,
              "properties": {
              "sse_algorithm": "AES256"
            }
        },
        {
              "source": {
                "file": "5abce8191c948ec3c0ce2b7f"
              },
              "destination": {
                "volume": "rfranklin/output",
                "location": "output.vcf"
              },
              "overwrite": false,
              "properties": {
              "sse_algorithm": "AES256"
            }
        }
         
    ]
}

Response

See a list of response codes that may be contained in the body of the response..

Response body

The response object contains information about all of the exported items. The information is structured using the following key-value pairs:

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.

Example response body

{
    "items": [
        {
            "resource": {
                "href": "https://api.sb.biodatacatalyst.nhlbi.nih.gov/v2/storage/exports/MiNOzItzc9HpRfZxoGp3YTZE8STJMZmI",
                "id": "MiNOzItzc9HpRfZxoGp3YTZE8STJMZmI",
                "state": "PENDING",
                "source": {
                    "file": "5abce8051c948ec3c0ce2b7c"
                },
                "destination": {
                    "volume": "rfranklin/output",
                    "location": "output.vcf"
                },
                "properties": {
                    "sse_algorithm": "AES256",
                    "sse_aws_kms_key_id": null,
                    "aws_canned_acl": null
                },
                "overwrite": true
            }
        },
        {
            "resource": {
                "href": "https://api.sb.biodatacatalyst.nhlbi.nih.gov/v2/storage/exports/1sKqNbEI8nrb3TGui6OD3ATRz1XxDRIi",
                "id": "1sKqNbEI8nrb3TGui6OD3ATRz1XxDRIi",
                "state": "PENDING",
                "source": {
                    "file": "5abce8191c948ec3c0ce2b7f"
                },
                "destination": {
                    "volume": "rfranklin/output.vcf",
                    "location": "output.vcf"
                },
                "properties": {
                    "sse_algorithm": "AES256",
                    "sse_aws_kms_key_id": null,
                    "aws_canned_acl": null
                },
                "overwrite": false
            }
        }
    ]
}