Re-run an automation

This call re-runs a specified automation run. This call is useful in case you want to use most of the inputs and settings from the original run and only change a few.

The default API behavior is to merge inputs and settings from the original run with whatever inputs and settings you specify for the re-run. To override this and only apply the new inputs and settings, set the merge parameter to false."

Request

https://api.sbgenomics.com/v2/automation/runs/{run_id}/actions/rerun
https://eu-api.sbgenomics.com/v2/automation/runs/{run_id}/actions/rerun

Example request

POST v2/automation/runs/5259c50e1ac5426ea8f1273259740f75/actions/rerun
Host: api.sbgenomics.com
X-SBG-Auth-Token: 3259c50e1ac5426ea8f1273259740f75
curl -X POST \
  https://api.sbgenomics.com/v2/automation/runs/5259c50e1ac5426ea8f1273259740f75/actions/rerun
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -H 'X-SBG-Advance-Access: advance' \
  -H 'X-SBG-Auth-Token: b04aa2a2e98348a1a3a75ca677ea7fd7'
  "
    ]
}
'
from sevenbridges import Api

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

# send POST request to SB API
run = api.automation_runs.rerun(
    id='5259c50e1ac5426ea8f1273259740f75',
    package='ca7d8d82-ea7b-4178-8699-acc2a44b06dc',
    inputs={'project_name': 'My project'},
    name='my rerun v0.0.5'
)

print(run.id, run.status)

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

Query parameters

Name

Data type

Description

merge

boolean

The default API behaviour is to merge inputs and settings from the original run with whatever inputs and settings you specify for the rerun.

To override this and only apply the new inputs and settings, set the merge parameter to false."

###Request body
In the body, you should enter a list of key-value pairs. The keys, and the values they take, are described in the following table.

Name

Data type

Description

name

string

The name of the automation run you are creating.

package

string

The code package UUID.

inputs

dictionary of key-value pairs

Automation inputs specified as a JSON string. Overwrites inputs from original run.

settings

dictionary of key-value pairs

Automation settings specified as a JSON string. Overwrites settings from original run."

secret_settings

dictionary of key-value pairs

Same as above with the only difference that these values will not be logged or visible anywhere. You can use this field to specify credentials or any other confidential information.

memory_limit

integer

Set the memory limit for the re-running an automation, specified in MB.

The default value is 500MB while the maximum allowed is 4000MB.

If no specific limit is set for a code package or automation run, this value will be used.

Example request body

{"name": "my re-run v0.0.5",
"package": "ca7d8d82-ea7b-4178-8699-acc2a44b06dc", 
"inputs": {"project_name": "My project"}
}

Response

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

Example response body

{
    "id": "8e371af8-0b64-45dc-9eeb-606ccfb71e78",
    "name": "my re-run v0.0.5",
    "href": "https://api.sbgenomics.com/v2/automation/runs/8e371af8-0b64-45dc-9eeb-606ccfb71e78",
    "automation": {
        "id": "77d90746-81b6-494a-88f7-901b4ebdc8e0",
        "href": "https://api.sbgenomics.com/v2/automation/automations/77d90746-81b6-494a-88f7-901b4ebdc8e0",
        "name": "run_sdk5731",
        "description": "Re-run of the automation",
        "owner": "rfranklin",
        "archived": false,
        "created_by": "rfranklin",
        "created_on": "rfranklin",
        "modified_on": "rfranklin",
        "modified_by": "rfranklin"
    },
    "inputs": {
        "project_name": "My project"
    },
    "settings": {},
    "status": "QUEUED_FOR_EXECUTION",
    "message": "",
    "package": {
        "id": "ca7d8d82-ea7b-4178-8699-acc2a44b06dc",
        "automation": "77d90746-81b6-494a-88f7-901b4ebdc8e0",
        "version": "0.0.1",
        "location": "5e29ad26e4b0cbeff6b199d7",
        "archived": false,
        "created_by": "rfranklin",
        "created_on": "2020-01-23T14:26:48.683Z"
    },
    "created_on": "2020-01-23T14:29:30.212Z",
    "start_time": null,
    "end_time": null,
    "resumed_from": null,
    "created_by": "rfranklin",
    "execution_details": {},
    "memory_limit":1000
}