POST
Creates a new file storage location in the server file repository. The location sets up a file location on a disk mount point on the server.
Before you can import files through the API, you must POST a request to the glsstorage resource. This allocates a location where you can place the file that you want to work with through the API.
To request a storage location, your POST request must contain values in the original-location and attached-to elements. The system uses these values to determine the target location for the file, and to generate and assign a LIMS ID. This information is returned to you as a value in the content-location element of the response XML. Once you have the information, you must place the file in the specified location, and then POST the returned XML to the files resource in order to associate the file in the system.
To summarize, when importing a file using the API, you must: <ol>
Input Payload
element | consumeable content type(s) |
---|---|
file (XML) |
|
description | |
The information about the file you want to eventually import into the system. Here is an example <file> in xml format. Note the attached-to uri will need to match an existing resource in your system. Allowed resource types are: project, sample, process, or a file artifact type such as a result file. <file:file xmlns:file="http://genologics.com/ri/file"> <attached-to>http://localhost:8080/api/v2/artifacts/LUN3A1PA1</attached-to> <original-location>/home/glsftp/Testing/results.csv</original-location> </file:file> |
Output Payload
element | produceable content type(s) |
---|---|
file (XML) |
|
description | |
When the storage location is successfully allocated, the system returns an HTTP 200 (Ok) code with a
response body containing a value in the content-location element, indicating where you should store
the file.
Here is an example response in xml format: <file:file xmlns:file="http://genologics.com/ri/file"> <content-location>sftp://localhost/local_home/glsftp/Process/2005/6/HDX-FWX-050601-79-2/HDE2A1TP16-10-13.raw</content-location> <attached-to>http://localhost:8080/api/v2/artifacts/LUN3A1PA1</attached-to> <original-location>/home/glsftp/Testing/results.csv</original-location> </file:file> |