This function uploads a file to the Raw Data Repository. It takes a file path, metadata schema, and metadata as
inputs and returns the response from the EnviroData API. See get_tenant_file_schemas
for a list
of existing metadata schemas for a given tenant. If there is an error during the upload, an error message is logged.
upload_file_to_rdr(full_file_path, metadata_schema, metadata)
A string representing the full file path of the file to be uploaded to RDR.
A string representing the name of the metadata schema for the file being uploaded.
A list containing metadata key-value pairs for the file being uploaded.
A parsed response from the RDR API indicating whether the file upload was successful or not.
full_file_path <- "path/to/your/file.txt"
metadata_schema <- "your_metadata_schema_name"
metadata <- list(key1 = "value1", key2 = "value2")
response <- upload_file_to_rdr(full_file_path, metadata_schema, metadata)