Get details of an export job

📘

When exporting a file from the Platform to an attached volume, export is possible only to a volume that is in the same location (cloud provider and region) as the project from which the file is being exported.

This call will return the details of an export job.

When you export a file from a project on the Platform into a volume, you write to your cloud storage bucket. This call obtains the details of that job.

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

Request

https://api.sbgenomics.com/v2/storage/exports/{export_id}
https://eu-api.sbgenomics.com/v2/storage/exports/{export_id}

Example request

GET /v2/storage/exports/gW26LlICb9MmJkalaWEeI3HvJkbgvIh8 HTTP/1.1
Host: api.sbgenomics.com
X-SBG-Auth-Token: 3259c50e1ac5426ea8f1273259740f74
Content-type: application/json
curl -s -H "X-SBG-Auth-Token: 7942f56901534434a054dafc3813bc96" -H "Content-Type: application/json" -X GET "https://api.sbgenomics.com/v2/storage/exports/gW26LlICb9MmJkalaWEeI3HvJkbgvIh8"
from sevenbridges import Api, ImportExportState

api = Api(url='https://api.sbgenomics.com/v2',
          token='3259c50e1ac5426ea8f1273259740f74')

# send GET request to SB API
export = api.exports.get(id='gW26LlICb9MmJkalaWEeI3HvJkbgvIh8')

print(export.id, export.state)
if export.state == ImportExportState.FAILED:
    print(export.error)
if export.state == ImportExportState.COMPLETED:
    file = export.result
    print(file.id, file.name)

Header Fields

Key

Description of value

X-SBG-Auth-Token
required

Your Seven Bridges Platform authentication token.

Content-type
required

application/json

Path parameters

Key

Description of value

export_id

The ID of the export job as returned by the call to start an export job.

Response

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

Response body

The response object contains information about the status of the export job. The information is structured using the following key-value pairs:

Key

Data type of value

Description of value

id

String

ID of this export job

state

String

The state of this export job. Possible values are:

  • PENDING: the export is queued;
  • RUNNING: the export is running;
  • COMPLETED: the export has completed successfully;
  • FAILED: the export has failed.

source

Object

Export source, as passed when this job was started by the call to start an export job .

file

String

ID of the file that was exported.

destination

Object

Export destination, as passed when this job was started by the call to start an export job.

volume

String

ID of the volume where to export.

location

String

Location on the volume where the file should be exported.

started_on

String

Time when the export job was started.

finished_on

String

Time when the export job was finished.

properties

Object

Contains properties related to the export, including:

  • "sse_algorithm" - algorithm used for S3 encryption
  • "aws_storage_class" - storage class (STANDARD or GLACIER)
  • "aws_canned_acl" - ACL which is set on the S3 bucket

overwrite

Boolean

Whether the file should be overwritten in the destination.

Example response body - successfully completed export

{
  "href": "https://api.sbgenomics.com/v2/storage/exports/gW26LlICb9MmJkalaWEeI3HvJkbgvIh8",
  "id": "gW26LlICb9MmJkalaWEeI3HvJkbgvIh8",
  "state": "COMPLETED",
  "source": {
    "file": "576159f7f5b4e1de6ae9b5f0"
  },
  "destination": {
    "volume": "rfranklin/output",
    "location": "output.vcf"
  },
  "started_on": "2016-06-15T19:17:39Z",
  "finished_on": "2016-06-15T19:17:41Z",
  "properties": {
    "sse_algorithm": "AES256",
    "aws_storage_class": "STANDARD",
    "aws_canned_acl": "public-read"
  },
  "overwrite": false
}

Example response body - failed export

{
  "href": "https://api.sbgenomics.com/v2/storage/exports/19K01S2JNGdsI8pSV1IeLoh2eM0A60hK",
  "id": "19K01S2JNGdsI8pSV1IeLoh2eM0A60hK",
  "state": "FAILED",
  "error": {
    "status": 409,
    "code": 9107,
    "message": "Location on volume already contains a file. Check the documentation.",
    "more_info": "http://docs.sevenbridges.com/docs/api-status-codes#9107"
  },
  "source": {
    "file": "57679b78f5b42122e7fde6a9"
  },
  "destination": {
    "volume": "rfranklin/output",
    "location": "_4_s3_file.jpg"
  },
  "started_on": "2016-06-22T13:38:57Z",
  "finished_on": "2016-06-22T13:38:57Z",
  "properties": {
    "sse_algorithm": "AES256",
    "sse_aws_kms_key_id": "6762ec77-01e3-42cc-ba3f-de371ec2359b",
    "aws_canned_acl": "public-read"
  },
  "overwrite": false
}