FileWriteRequest¶
- class tracdap.api.FileWriteRequest¶
Request to create or update a FILE and store content to the platform.
See also
- content: bytes¶
A chunk of the file content
The file content should be sent as a stream of chunks (byte buffers), with one chunk in each message. Empty chunks can be included at any point in the request stream and will be ignored.
- mimeType: str¶
Mime type of the file being saved, always required
Must be a valid mime type. For update requests, the mime type must match exactly with the mime type supplied when the file was originally created. Attempting to change the mime type in an update will result in an error status of FAILED_PRECONDITION.
Mime type is stored in the file definition and in the trac_file_mime_type attribute.
- name: str¶
File name of the file being saved, always required
Must be a valid file name with no path component (i.e. the name may not contain slashes).
If the name contains a period character, the file extension will be set as the portion of the name following the last period. Otherwise the file extension will be blank.
For update requests the name may change but the extension must stay the same. E.g. a file can be created as “my_file_v1.txt” and updated as “my_file_v2.txt”, but updating with the name as “my_file_v1.doc” would not be allowed. Attempting to change the extension in an update will result in an error status of FAILED_PRECONDITION.
Fle name and extension are stored in the file definition, and in the trac_file_name and trac_file_extension attributes.
- priorVersion: tracdap.metadata.TagSelector | None¶
Prior object/tag version to use for update operations
This field should be omitted when creating a new file.
- size: int | None¶
Size of the file being saved, if known in advance
When a size is supplied, TRAC will check the size against the number of bytes stored. If the stored file size does not match the supplied value, the error will be reported with an error status of DATA_LOSS. When no size is supplied the check cannot be performed.
File size is stored in the created file definition and in the trac_file_size attribute.
- tagUpdates: List[tracdap.metadata.TagUpdate]¶
Tag update operations to be applied
Tag updates are applied in exactly the same way as for metadata write requests.
See also
- tenant: str¶
Tenant code for the requested operation, always required