Ingest Python Module¶
Core interface for the ingest of metadata objects.
Example uploaded data:
[
{"destinationTable": "Transactions._id", "value": 1234},
{"destinationTable": "Transactions.submitter", "value": 34002},
{"destinationTable": "Transactions.proposal", "value": 34002},
{"destinationTable": "Transactions.instrument", "value": 34002},
{"destinationTable": "TransactionKeyValue", "key": "Tag", "value": "Blah"},
{"destinationTable": "TransactionKeyValue", "key": "Taggy", "value": "Blah"},
{"destinationTable": "TransactionKeyValue", "key": "Taggier", "value": "Blah"}
{
"destinationTable": "Files",
"_id": 34, "name": "foo.txt", "subdir": "a/b/",
"ctime": "Tue Nov 29 14:09:05 PST 2016",
"mtime": "Tue Nov 29 14:09:05 PST 2016",
"size": 128, "mimetype": "text/plain"
},
{
"destinationTable": "FileKeyValue",
"key": "Micronic Adjustment",
"value": "5.66%",
"file_id": 34
},
{
"destinationTable": "Files",
"_id": 35, "name": "bar.txt", "subdir": "a/b/",
"ctime": "Tue Nov 29 14:09:05 PST 2016",
"mtime": "Tue Nov 29 14:09:05 PST 2016",
"size": 47, "mimetype": "text/plain"
},
]
-
class
pacifica.metadata.rest.ingest.
IngestAPI
¶ Uploader ingest API.
-
static
PUT
(*args, **kwargs)¶ Wrapper to connect and close connection to database.
-
__weakref__
¶ list of weak references to the object (if defined)
-
static
validate_file_meta
(file_meta)¶ Validate the file metadata.
-
static
validate_hash_data
(hashtype, hashsum)¶ Validate the hashtype and hashsum are valid.
-
static
validate_mime_type
(mimetype)¶ Validate the mimetype string.
-
static