Initialize a multipart code package upload

This call initializes a multipart code package upload.

Request

https://api.sbgenomics.com/v2/automation/upload
https://eu-api.sbgenomics.com/v2/automation/upload

Example request

POST /v2/automation/upload HTTP/1.1
Host: api.sbgenomics.com
X-SBG-Auth-Token: 4e786405a9f54c00997f7a2a5484186d
X-SBG-Advance-Access: advance
Content-Type: application/json

{
        "automation_id": "22325e43-7308-4060-ad53-ff3378ba077e",
        "name": "test-2",
        "size": 124980,
        "part_size": 1,
        "md5": "1f240c5c6bd3ece0f54fa1066916b137"
    }
curl --location --request POST 'https://api.sbgenomics.com/v2/automation/upload' \
--header 'X-SBG-Auth-Token: 4e786405a9f54c00997f7a2a5484186d' \
--header 'X-SBG-Advance-Access: advance' \
--header 'Content-Type: application/json' \
--data-raw '{
        "automation_id": "22325e43-7308-4060-ad53-ff3378ba077e",
        "name": "test-2",
        "size": 124980,
        "part_size": 1,
        "md5": "1f240c5c6bd3ece0f54fa1066916b137"
    }'
from sevenbridges import Api

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

automation = api.automations.get(id='22325e43-7308-4060-ad53-ff3378ba077e')

# send POST request to SB API; this will upload the local code package
package = automation.add_package(
    version='0.0.1',
    file_path='local/path/to/automation_code.package',
    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'
            }
        }
    },
    file_name='test-2'
)

print(package.id, package.location)

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

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.

Key

Type

Description

automation_id

string

The ID of the automation the code package belongs to

name

string

The name of the code package that is uploaded.

size

string

The code package size.

part_size

string

The part size.

md5

string

Response

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

Example response body

{
    "href": "https://api.sbgenomics.com/v2/automation/upload/uL0twYpkY84qgo211CZUKqWwXnlUcUqZ0T6FKxrbcD6yap7k6tHBsruVyJ8z78jI",
    "upload_id": "uL0twYpkY84qgo211CZUKqWwXnlUcUqZ0T6FKxrbcD6yap7k6tHBsruVyJ8z78jI",
    "automation_id": "22325e43-7308-4060-ad53-ff3378ba077e",
    "name": "test-2",
    "size": 124980,
    "part_size": 1073741824,
    "parallel_uploads": true
}