Access an automation log file

This call returns the file ID of the automation log file. You can then use another API call to retrieve the URL for downloading the file. For automation runs that are still active, multiple file IDs are returned, one for each 2 minute interval.

The before query parameter is used to specify the timestamp which will be used as a reference for generating the log file. The response will include IDs for all files generated prior to the specified time.

To be able to access the log file of an automation the minimum required permissions are COPY and READ.

Request

https://api.sbgenomics.com/v2/automation/runs/{run-id}/logs?before=n
https://eu-api.sbgenomics.com/v2/automation/runs/{run-id}/logs?before=n

Example request

GET /v2/automation/runs/812ee6a7-d774-48db-b6b1-f3f4f85ffbf2/logs HTTP/1.1
Host: api.sbgenomics.com
X-SBG-Auth-Token: 3259c50e1ac5426ea8f1273259740f74
curl -s -H GET /v2/automation/runs/812ee6a7-d774-48db-b6b1-f3f4f85ffbf2/logs?last=10 HTTP/1.1
Host: api.sbgenomics.com
X-SBG-Auth-Token: a5f1e3fea4344ec4962b151dd0846af2
X-SBG-Advance-Access: advance
from sevenbridges import Api

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

# send GET request to SB API; fetches all run info
run = api.automation_runs.get(id='812ee6a7-d774-48db-b6b1-f3f4f85ffbf2')

log_file = run.get_log_file()

print(log_file.id, log_file.size)

Header Fields

Name

Description

X-SBG-Auth-Token
required

Your Seven Bridges Platform authentication token.

Content-Type
required

application/json

X-SBG-Advance-Access
required

advance

Path parameters

Name

Description

run_id
required

The ID of the automation run you are querying.

Query parameter

Name

Description

before

Specify the timestamp (seconds since Jan 01 1970. (UTC)), e.g. "1578581194".

The response will include all IDs of files created prior to the specified time.

Response

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

Example response body

The response contains information on when each log file was created as well as the file_id, which you will need to retrieve the URL for downloading the file](doc:get-downloadable-url-for-a-file).

[
    {
        "created_at": "2019-11-07T15:42:43.222183",
        "file_id": "5dc43b72e4b08b38c6608422"
    }
]