Data Acquisition

File Upload

This endpoint uploads a file to TetraScience Cloud. It requires a user-defined agent set up in the TetraScience Web UI. API users can use it to upload, manage their files, and trigger pipelines.

Maximum payload size: 500MB

Validations performed by this endpoint:

  1. agentId must be a valid ID of the user defined agent (UDA)
  2. param sourceType must contain only lower case alphanumerical characters and dashes
  3. params metadata and tags must contain only ASCII characters; tags values cannot contain comma and values must be unique
  4. params metadata and tags together as JSON objects must have less than 1.5KB of text (1536 characters)
post/v1/data-acquisition/agent/upload

Request

  • Base URL
    https://api.tetrascience.com
  • URL
    https://api.tetrascience.com/v1/data-acquisition/agent/upload
  • Auth
    API key in header ts-auth-token and API key in header x-org-slug

Request body multipart/form-data

agentIdstring required

This is the sourceId for a user-defined integration. Need to copy from the TetraScience Web UI where the user-defined integration is created. For existing TetraScience Agent who can connect to TetraScience Cloud directly, provide the agentId to this field.

agent'TetraScience.Agent.file-log' | 'TetraScience.Agent.empower' | 'TetraScience.Agent.unicorn' | 'TetraScience.Agent.labx' | 'TetraScience.Agent.chromeleon' | 'TetraScience.Agent.user-defined'

Type of agent, in the form TetraScience.Agent.file-log, TetraScience.Agent.empower, etc. If provided, object in data lake will have the metadata value agent in the form of agent agentVersion (for example, `TetraScience.Agent.file-log v4.3.0')

agentVersionstring

Version of the agent that's uploading the file (for example, v4.3.0)

sourceTypestring

If provided, this field will overwrite the sourceType configured in the TetraScience Web UI. Default value: unknown A valid sourceType string can contain only alphanumeric characters in lower case letters and dash. Any other character will trigger validation error.

fileCategory'RAW' | 'PROCESSED'

The file category of the uploaded file, included in the datalake path.

fileIdstring

If provided, it must be a valid and unique UUID. If not provided, platform will generate unique UUID value.

traceIdstring

A valid UUID, if provided. If not present, system will use the fileId value

filePathstring required

Required. An example of filePath can be /experiment_2/sample a/result.pdf

filestring binary required

Content of a single file to upload

payloadGzipstring

If set to true, indicates the file content is gzip compressed. If false or omitted, the content will be gzipped during upload. Default value: false.

metadatastring

JSON string as {"key", "value"}. The metadata and value will overwrite metadata defined for the user-defined integration in the TetraScience Web UI. Validations: fields and values must contain only ASCII characters; values must be either string or null values.

tagsstring

JSON string as ["tag 1", "tag 2"]. Validations: values must contain only ASCII characters; value must not have comma (,); values must be unique

labelsstring

JSON string as [{"name":"label name", "value":"label value"}]. The labels will join the agent defined labels. Validations: Names can include any unicode characters, except line breaks. They cannot be empty, and they have a maximun length of 128 characters. Values can include any unicode characters, except line breaks, and they cannot be empty.

Response

200

typestring
fileKeystring
bucketstring
versionstring
fileIdstring

Example response

{
  "type": "s3file",
  "fileKey": "demo/1cd9ffeb-1e10-45d2-a8d6-61a88c829e5c/RAW/test/raw.json",
  "bucket": "ts-platform-env-datalake",
  "version": "grXOL0hSiCeKu094tBw.mu4LXQErWzGT",
  "fileId": "c4c6cfdf-67d0-4672-a1a6-0b9f558d0156"
}

Changes

No recorded changes to this operation across all 1 revision of this API.