diff --git a/data-computer/examples.http b/data-computer/examples.http index 39ad253..325dbb3 100644 --- a/data-computer/examples.http +++ b/data-computer/examples.http @@ -15,13 +15,23 @@ ] ### -# @name v1collect -POST {{baseUrl}}/v1/collect?indent=true HTTP/1.1 +# @name v1RetrieveJSON +POST {{baseUrl}}/v1/retrieve-json?indent=true HTTP/1.1 Content-Type: application/json [ { - "value":"8RjaJDej5" + "value":"fRDWhEhay" + } +] +### +# @name v1RetrieveCSV +POST {{baseUrl}}/v1/retrieve-csv?indent=true HTTP/1.1 +Content-Type: text/csv + +[ + { + "value":"QjiWLMeKC" } ] diff --git a/data-computer/v1/collect.ini b/data-computer/v1/collect.ini deleted file mode 100644 index 2b52998..0000000 --- a/data-computer/v1/collect.ini +++ /dev/null @@ -1,36 +0,0 @@ -# Entrypoint output format -mimeType = application/json - -# OpenAPI Documentation - JSON format (dot notation) -post.operationId = post-v1-collect -post.description = Récupération d'un résultat produit sous forme d'un flux json -post.summary = Les traitements étant asynchrones le résultat une fois créé doit être récupéré par cette route -post.tags.0 = data-computer -post.responses.default.description = Fichier corpus au format tar -post.requestBody.content.application/json.example.0.value = xMkWJX7GU -post.requestBody.content.application/json.schema.$ref = #/components/schemas/JSONStream -post.requestBody.required = true -post.parameters.0.description = Indenter le JSON résultant -post.parameters.0.in = query -post.parameters.0.name = indent -post.parameters.0.schema.type = boolean - -[use] -plugin = basics - -[JSONParse] -separator = * - -[exchange] -value = get('value') - -[FILELoad] -location = /tmp/retrieve - -[TARExtract] -compress = true -path = */*.json - -[JSONString] -indent = env('indent') - diff --git a/data-computer/v1/retrieve-csv.ini b/data-computer/v1/retrieve-csv.ini new file mode 100644 index 0000000..2d4cd4c --- /dev/null +++ b/data-computer/v1/retrieve-csv.ini @@ -0,0 +1,35 @@ +# Entrypoint output format +mimeType = text/csv + +# OpenAPI Documentation - JSON format (dot notation) +post.operationId = post-v1-retrieve-csv +post.description = Récupération d'un résultat produit sous forme d'un flux CSV +post.summary = Les traitements étant asynchrones le résultat, une fois créé, doit être récupéré par cette route +post.tags.0 = data-computer +post.responses.default.description = Fichier corpus en version CSV +post.requestBody.content.application/json.example.0.value = xMkWJX7GU +post.requestBody.content.application/json.schema.$ref = #/components/schemas/JSONStream +post.requestBody.required = true + +[use] +plugin = basics + +[JSONParse] +separator = * + +[exchange] +value = get('value') + +[FILELoad] +location = /tmp/retrieve + +[TARExtract] +compress = true +path = */*.json + +[exchange] +value = self().mapValues(value => typeof value === 'object' ? JSON.stringify(value) : value) + +[CSVString] +separator = fix(',') +format = strict diff --git a/data-computer/v1/retrieve-json.ini b/data-computer/v1/retrieve-json.ini new file mode 100644 index 0000000..5ae55b1 --- /dev/null +++ b/data-computer/v1/retrieve-json.ini @@ -0,0 +1,36 @@ +# Entrypoint output format +mimeType = application/json + +# OpenAPI Documentation - JSON format (dot notation) +post.operationId = post-v1-retrieve-json +post.description = Récupération d'un résultat produit sous forme d'un flux json +post.summary = Les traitements étant asynchrones le résultat, une fois créé, doit être récupéré par cette route +post.tags.0 = data-computer +post.responses.default.description = Fichier corpus au format JSON +post.requestBody.content.application/json.example.0.value = xMkWJX7GU +post.requestBody.content.application/json.schema.$ref = #/components/schemas/JSONStream +post.requestBody.required = true +post.parameters.0.description = Indenter le JSON résultant +post.parameters.0.in = query +post.parameters.0.name = indent +post.parameters.0.schema.type = boolean + +[use] +plugin = basics + +[JSONParse] +separator = * + +[exchange] +value = get('value') + +[FILELoad] +location = /tmp/retrieve + +[TARExtract] +compress = true +path = */*.json + +[JSONString] +indent = env('indent') + diff --git a/data-workflow/v1/collect.ini b/data-workflow/v1/collect.ini deleted file mode 100644 index 213b12b..0000000 --- a/data-workflow/v1/collect.ini +++ /dev/null @@ -1,36 +0,0 @@ -# Entrypoint output format -mimeType = application/json - -# OpenAPI Documentation - JSON format (dot notation) -post.operationId = post-v1-collect -post.summary = Récupération d'un résultat produit sous forme d'un flux json -post.description = Les traitements étant asynchrones le résultat une fois créé doit être récupéré par cette route -post.tags.0 = data-computer -post.responses.default.description = Fichier corpus au format tar -post.requestBody.content.application/json.example.0.value = xMkWJX7GU -post.requestBody.content.application/json.schema.$ref = #/components/schemas/JSONStream -post.requestBody.required = true -post.parameters.0.description = Indenter le JSON résultant -post.parameters.0.in = query -post.parameters.0.name = indent -post.parameters.0.schema.type = boolean - -[use] -plugin = basics - -[JSONParse] -separator = * - -[exchange] -value = get('value') - -[FILELoad] -location = /tmp/retrieve - -[TARExtract] -compress = true -path = */*.json - -[JSONString] -indent = env('indent') - diff --git a/data-workflow/v1/retrieve-csv.ini b/data-workflow/v1/retrieve-csv.ini new file mode 100644 index 0000000..2d4cd4c --- /dev/null +++ b/data-workflow/v1/retrieve-csv.ini @@ -0,0 +1,35 @@ +# Entrypoint output format +mimeType = text/csv + +# OpenAPI Documentation - JSON format (dot notation) +post.operationId = post-v1-retrieve-csv +post.description = Récupération d'un résultat produit sous forme d'un flux CSV +post.summary = Les traitements étant asynchrones le résultat, une fois créé, doit être récupéré par cette route +post.tags.0 = data-computer +post.responses.default.description = Fichier corpus en version CSV +post.requestBody.content.application/json.example.0.value = xMkWJX7GU +post.requestBody.content.application/json.schema.$ref = #/components/schemas/JSONStream +post.requestBody.required = true + +[use] +plugin = basics + +[JSONParse] +separator = * + +[exchange] +value = get('value') + +[FILELoad] +location = /tmp/retrieve + +[TARExtract] +compress = true +path = */*.json + +[exchange] +value = self().mapValues(value => typeof value === 'object' ? JSON.stringify(value) : value) + +[CSVString] +separator = fix(',') +format = strict diff --git a/data-workflow/v1/retrieve-json.ini b/data-workflow/v1/retrieve-json.ini new file mode 100644 index 0000000..ed41949 --- /dev/null +++ b/data-workflow/v1/retrieve-json.ini @@ -0,0 +1,36 @@ +# Entrypoint output format +mimeType = application/json + +# OpenAPI Documentation - JSON format (dot notation) +post.operationId = post-v1-retrieve-json +post.summary = Récupération d'un résultat produit sous forme d'un flux JSON +post.description = Les traitements étant asynchrones le résultat une fois créé doit être récupéré par cette route +post.tags.0 = data-computer +post.responses.default.description = Fichier corpus au format JSON +post.requestBody.content.application/json.example.0.value = xMkWJX7GU +post.requestBody.content.application/json.schema.$ref = #/components/schemas/JSONStream +post.requestBody.required = true +post.parameters.0.description = Indenter le JSON résultant +post.parameters.0.in = query +post.parameters.0.name = indent +post.parameters.0.schema.type = boolean + +[use] +plugin = basics + +[JSONParse] +separator = * + +[exchange] +value = get('value') + +[FILELoad] +location = /tmp/retrieve + +[TARExtract] +compress = true +path = */*.json + +[JSONString] +indent = env('indent') +