@@ -82,82 +82,9 @@ environment variable for example).
The files must have the extension `.json`, and must be stored in that directory (not in a sub-directory).
Once the files are ready and the server is started, the harvest is triggered by sending a POST request
to the endpoint `/api/harvests`, without any request body.
This endpoint, as well as the actuator endpoints, is only accessible to an authenticated user. The user (`rare`) and its password (`f01a7031fc17`) are configured in the application.yml file (and can thus be overridden using environment variables for example).
to the endpoint `/api/harvests`, as described in the API documentation that you can generate using the
build task `asciidoctor`, which executes tests and generates documentation based on snippets generated
by these tests. The documentation is generated in the folder `backend/build/asciidoc/html5/index.html`/
Example with the `http` command ([HTTPie](https://httpie.org/)):
http --auth rare:f01a7031fc17 POST http://localhost:8080/api/harvests
Example with the `curl` command:
curl -i -X POST -u rare:f01a7031fc17 http://localhost:8080/api/harvests
The harvest job is executed asynchronously, and a response is immediately sent back, with the URL allowing
"Error while parsing object: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `java.lang.String` out of START_ARRAY token\n at [Source: UNKNOWN; line: -1, column: -1] (through reference chain: fr.inra.urgi.rare.domain.GeneticResource[\"name\"])",
pathParameters(parameterWithName("id").description("The ID of the harvest")),
responseFields(
fieldWithPath("id").description("The unique ID of the harvest"),
fieldWithPath("startInstant").description("The instant when the harvest job started"),
fieldWithPath("endInstant").description("The instant when the harvest job finished. Null if it's not finished yet"),
fieldWithPath("globalErrors").description("An array of global errors. Such a global error would exist, for example, for each file that can't be read"),
fieldWithPath("files").description("An array of files that have been harvested. Files that have not been harvested yet are not listed."),
fieldWithPath("files[].fileName").description("The name of the harvested file"),
fieldWithPath("files[].successCount").description("The number of resources in the files that have been harvested successfully"),
fieldWithPath("files[].errorCount").description("The number of resources in the files that couldn't be harvested due to an error"),
fieldWithPath("files[].errors").description("The errors that occurred while harvesting the file (one per failed resource)"),
fieldWithPath("files[].errors[].index").description("The index, starting at 0, of the resource in the JSON file"),
fieldWithPath("files[].errors[].error").description("The text of the error. The example error here shows that the name property, which is supposed to be a string, couldn't be parsed because it was an array"),
fieldWithPath("files[].errors[].line").description("The line number, in the JSON file, of the error. It's actually the line of the end of the resource object"),
fieldWithPath("files[].errors[].column").description("The column number, in the JSON file, of the error. It's actually the column of the end of the resource object")