post https://api.tetrascience.com/v1/datalake/metadata-tags
This endpoint appends metadata and tags to a target file in the datalake. This endpoint require either fileId
or bucket
, fileKey
and version
to be provided in order to uniquely identify file.
Target file query is determined by field originalFile
. Target file is queried in two ways:
- by
fileId
(UUID of a file in datalake) - by
bucket
,fileKey
andversion
Endpoint finds target file by given file query and creates new version with updated metadata and tags. If payload doesn't contain neither metadata
nor tags
, endpoint will return existing file from datalake.
Parameters metadata
and tags
description:
metadata
is JSON object, e.g. { "key1": "value", "key2": "2" }metadata
can have empty string valuesmetadata
entry field can be null and in that case it will remove custom metadata value on target filetags
is JSON array, e.g. ["a", "b"]
Here is an example payload for this endpoint:
{
"originalFile": {
"fileKey": "tetrascience/47ab98d5-cccb-4a7d-86f4-0ff8f7c11bdf/RAW/WAT12/Test_0504/Test_SignOff/PQ Sample Set/1135/19970917300559.json",
"bucket": "ts-platform-dev-datalake",
"version": "dUzbISdeNgKXuSsv.lUT73qr7lYoby_u",
"type": "s3file"
},
"metadata": {
"a": "a",
"b": "",
"c": "Test"
},
"tags": ["Boston", "San Fran", "123"]
}
It will append any existing metadata/tags with the ones listed in the payload.
Validations performed by this endpoint:
- if parameter
fileId
is not provided, then all three parametersbucket
,fileKey
andversion
be provided - if any of parameters
bucket
,fileKey
andversion
is not provided, then parameterfileId
must be provided metadata
keys can only include letters, numbers, spaces, and the symbols+
,-
, or_
metadata
values can only include letters, numbers, spaces, and the symbols+
,-
,_
,/
,.
or,
tags
must contain only letters, numbers, spaces, and the symbols+
,-
,.
,/
or_
and they must be uniquemetadata
andtags
together as JSON objects must have less than 1.5KB of text (1536 characters)