put https://api.tetrascience.com/v1/datalake/metadata-tags
This endpoint replaces 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,fileKeyandversion
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 remove all metadata and tags.
Parameters metadata and tags description:
metadatais JSON object, e.g. { "key1": "value", "key2": "2" }metadatacan have empty string valuesmetadataentry field can be null and in that case it will remove custom metadata value on target filetagsis 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 replace any existing metadata/tags with the ones listed in the payload.
Validations performed by this endpoint:
- if parameter
fileIdis not provided, then all three parametersbucket,fileKeyandversionbe provided - if any of parameters
bucket,fileKeyandversionis not provided, then parameterfileIdmust be provided metadatakeys can only include letters, numbers, spaces, and the symbols+,-, or_metadatavalues can only include letters, numbers, spaces, and the symbols+,-,_,/,.or,tagsmust contain only letters, numbers, spaces, and the symbols+,-,.,/or_and they must be uniquemetadataandtagstogether as JSON objects must have less than 1.5KB of text (1536 characters)
