Get details of an import job

This call will return the details of an import job.

Note that when you import a file from your volume on your cloud storage provider (Amazon Web Services or Google Cloud Storage), you are creating an alias on the Platform which points to the file in your cloud storage bucket. Aliases appear as files on the Platform and can be copied, executed, and modified as such. They refer back to the respective file on the given volume.

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

Request

https://api.sbgenomics.com/v2/storage/imports/{import_id}
https://eu-api.sbgenomics.com/v2/storage/imports/{import_id}

Example request

GET /v2/storage/imports/9G2EcQdEDNcfqTQN2NOGoy0pV0uHsDkR 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/imports/9G2EcQdEDNcfqTQN2NOGoy0pV0uHsDkR"
from sevenbridges import Api, ImportExportState

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

# send GET request to SB API
import_ = api.imports.get(id='9G2EcQdEDNcfqTQN2NOGoy0pV0uHsDkR')

print(import_.id, import_.state)
if import_.state == ImportExportState.FAILED:
    print(import_.error)
if import_.state == ImportExportState.COMPLETED:
    file = import_.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

import_id

The ID of the import job as returned by the call to start an import 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 import job. The information is structured using the following key-value pairs:

Key

Data type of value

Description of value

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 started by the call to 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.

Example response body

{
    "href": "https://api.sbgenomics.com/v2/storage/imports/9G2EcQdEDNcfqTQN2NOGoy0pV0uHsDkR",
    "id": "9G2EcQdEDNcfqTQN2NOGoy0pV0uHsDkR",
    "state": "COMPLETED",
    "overwrite": true,
    "autorename": false,
    "source": {
        "volume": "rfrankin/input",
        "location": "5714857613d176941a8355.bam"
    },
    "destination": {
        "project": "rfranklin/my-project",
        "name": "sample1.bam"
    },
    "result": {
        "href": "https://api.sbgenomics.com/v2/files/5bd30cf2e4b05ad8c940e89c",
        "id": "5bd30cf2e4b05ad8c940e89c",
        "name": "sample1.bam",
        "size": 10718145,
        "project": "rfranklin/my-project",
        "created_on": "2018-10-26T12:47:46Z",
        "modified_on": "2018-10-26T12:47:46Z",
        "storage": {
            "type": "VOLUME",
            "volume": "rfrankin/input",
            "location": "5714857613d176941a8355.bam"
        },
        "origin": {},
        "tags": [],
        "metadata": {}
    },
    "started_on": "2018-10-26T12:47:46Z",
    "finished_on": "2018-10-26T12:47:46Z"
}
{
    "href": "https://api.sbgenomics.com/v2/storage/imports/9mnpXABnkm0F5VLk4lUT6oiFCet860xg",
    "id": "9mnpXABnkm0F5VLk4lUT6oiFCet860xg",
    "state": "FAILED",
    "overwrite": true,
    "autorename": false,
    "source": {
        "volume": "rfranklin/input",
        "location": "5714857613d176941a8355.bam"
    },
    "destination": {
        "project": "rfranklin/my-project",
        "name": "sample1.bam"
    },
    "error": {
        "status": 404,
        "code": 9105,
        "message": "Location on volume not found.",
        "more_info": "http://docs.sevenbridges.com/docs/api-status-codes#9105"
    },
    "started_on": "2018-10-26T13:10:24Z",
    "finished_on": "2018-10-26T13:10:25Z"
}