-
Notifications
You must be signed in to change notification settings - Fork 30
Using the siegfried server
The siegfried server is built into the sf
tool. Simply run sf -serve
and provide a hostname:port. E.g. sf -serve localhost:5138
.
The siegfried server has two modes of identification: GET request, where a file or directory path is given in the URL and the server retrieves the file(s); or POST request, where the file is sent over the network as form-data. For GET requests, the file name or directory must be URL-safe base64 encoded.
GET /identify/base64_encoded_file_name_or_directory(?nr=true&format=csv|yaml|json)
E.g. http://localhost:5138/identify/YzpcTXkgRG9jdW1lbnRzXGhlbGxvX3dvcmxkLmRvYw==
nr
(optional) - this parameter can be used to stop sub-directory recursion when a directory path is given.
format
(optional) - this parameter can be used to select the output format (csv, yaml, json). Default is json. Alternatively, HTTP content negotiation can be used.
POST /identify(?format=csv|yaml|json)
Attach a file as form-data with the key "file".
E.g. curl localhost:5138/identify -F [email protected]
format
(optional) - this parameter can be used to select the output format (csv, yaml, json). Default is json. Alternatively, HTTP content negotiation can be used.
The siegfried server can be used as an identification tool within an Archivematica workflow. Here is an example Format Policy Registry script for using siegfried in this way:
<script src="https://gist.github.com/richardlehane/b0d8c304f8b52685f26d.js"></script>