Add a code package to an automation

This call adds a code package to an automation.

Request

https://api.sbgenomics.com/v2/automation/automations/automation-id/packages
https://eu-api.sbgenomics.com/v2/automation/automations/automation-id/packages

Example request

POST v2/automation/automations/d5b148d1-448f-4c6e-b023-f61e9733c677/packages
Host: api.sbgenomics.com
X-SBG-Auth-Token: 3259c50e1ac5426ea8f1273259720f72
curl -X POST \
  https://api.sbgenomics.com/v2/automation/automations/d5b148d1-448f-4c6e-b023-f61e9733c677/packages \
  -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; adds an existing file as code package
package = api.automation_packages.create(
    automation='d5b148d1-448f-4c6e-b023-f61e9733c677',
    version='0.0.1',
    location='5eb28f00e4b0d73fb6c3b97e',
    schema={
        'inputs': {
            'input1': {
                'type': 'String',
                'meta': {
                    'ui_type': 'text'
                },
                'required': True,
                'default': 'None',
                'description': 'None'
            }
        },
        'outputs': {
            'output1': {
                'type': 'Int',
                'meta': {
                    'ui_type': 'number'
                },
                'description': 'None'
            }
        }
    },
    memory_limit=1000
)

print(package.id)

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

automation-id
required

The ID of the automation you are adding the code package to.

###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

location
required

string

File ID of the uploaded code package.

version
required

string

The code package version.

memory_limit

integer

Set the memory limit for the code package, specified in MB.

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

If omitted, the limit will be inherited from the automation entity when creating an automation run.

schema
required

dictionary of key-value pairs

Input/output schema JSON.

secret_settings

dictionary of key-value pairs

Use these settings to override default automation secret settings.

This will not be shown in an execution log or automation run info.

Example request body

{  
   "location":"5eb28f00e4b0d73fb6c3b97e",
   "version":"0.0.1",
   "memory_limit: 1000,
   "schema":{
      "inputs":{
         "input1":{
            "type":"String",
            "meta":{
               "ui_type":"text"
            },
            "required":True,
            "default":"None",
            "description":"None"
         }
      },
      "outputs":{
         "output1":{
            "type":"Int",
            "meta":{
               "ui_type":"number"
            },
            "description":"None"
         }
      },
      "settings":{
      },
      "secrets":{
      }
   }
}

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": "d49c8aee-93b5-4e2a-bdbc-d610f4fc4e40",
    "automation": "d5b148d1-448f-4c6e-b023-f61e9733c677",
    "version": "0.0.1",
    "location": "6647751c-a576-475d-9fc5-7153f069f79b",
    "memory_limit: 1000
    "created_by": "rfranklin",
    "created_on": "2019-02-05T14:54:38.531Z"
}