diff --git a/data-computer/examples.http b/data-computer/examples.http index a9ad03c..39ad253 100644 --- a/data-computer/examples.http +++ b/data-computer/examples.http @@ -29,7 +29,26 @@ # @name v1baseLine POST {{baseUrl}}/v1/base-line HTTP/1.1 Content-Type: application/x-tar -X-Hook: https://webhook.site/69300b22-a251-4c16-9905-f7ba218ae7e9 +X-Webhook-Success: https://webhook.site/69300b22-a251-4c16-9905-f7ba218ae7e9 +X-Webhook-Failure: https://webhook.site/69300b22-a251-4c16-9905-f7ba218ae7e9 + +< ./example-json.tar.gz + +### +## @name v1mockerrorsync +POST {{baseUrl}}/v1/mock-error-sync HTTP/1.1 +Content-Type: application/x-tar +X-Webhook-Success: https://webhook.site/69300b22-a251-4c16-9905-f7ba218ae7e9 +X-Webhook-Failure: https://webhook.site/69300b22-a251-4c16-9905-f7ba218ae7e9 + +< ./example-json.tar.gz + +### +### @name v1mockerrorasync +POST {{baseUrl}}/v1/mock-error-async HTTP/1.1 +Content-Type: application/x-tar +X-Webhook-Success: https://webhook.site/69300b22-a251-4c16-9905-f7ba218ae7e9 +X-Webhook-Failure: https://webhook.site/69300b22-a251-4c16-9905-f7ba218ae7e9 < ./example-json.tar.gz @@ -37,7 +56,8 @@ # @name v1TreeSegment POST {{baseUrl}}/v1/tree-segment HTTP/1.1 Content-Type: application/x-tar -X-Hook: https://webhook.site/69300b22-a251-4c16-9905-f7ba218ae7e9 +X-Webhook-Success: https://webhook.site/69300b22-a251-4c16-9905-f7ba218ae7e9 +X-Webhook-Failure: https://webhook.site/69300b22-a251-4c16-9905-f7ba218ae7e9 < ./example-json.tar.gz @@ -46,7 +66,8 @@ # @name v1GraphSegment POST {{baseUrl}}/v1/graph-segment HTTP/1.1 Content-Type: application/x-tar -X-Hook: https://webhook.site/69300b22-a251-4c16-9905-f7ba218ae7e9 +X-Webhook-Success: https://webhook.site/69300b22-a251-4c16-9905-f7ba218ae7e9 +X-Webhook-Failure: https://webhook.site/69300b22-a251-4c16-9905-f7ba218ae7e9 < ./example-json.tar.gz @@ -55,7 +76,8 @@ # @name v1Lda POST {{baseUrl}}/v1/lda HTTP/1.1 Content-Type: application/x-tar -X-Hook: https://webhook.site/69300b22-a251-4c16-9905-f7ba218ae7e9 +X-Webhook-Success: https://webhook.site/69300b22-a251-4c16-9905-f7ba218ae7e9 +X-Webhook-Failure: https://webhook.site/69300b22-a251-4c16-9905-f7ba218ae7e9 < ./example-json.tar.gz diff --git a/data-computer/v1/mock-error-async.ini b/data-computer/v1/mock-error-async.ini new file mode 100644 index 0000000..c4c499c --- /dev/null +++ b/data-computer/v1/mock-error-async.ini @@ -0,0 +1,61 @@ +# Entrypoint output format +mimeType = application/json + +# OpenAPI Documentation - JSON format (dot notation) +post.operationId = post-v1-mock-error-async +post.description = Chargement et analyse d'un fichier corpus et simule une erreur lros d'un traitement +post.summary = Simule une erreur synchrone, apres que le traitment soit lancé. +post.tags.0 = data-computer +post.requestBody.content.application/x-tar.schema.type = string +post.requestBody.content.application/x-tar.schema.format = binary +post.requestBody.required = true +post.responses.default.description = Informations permettant de récupérer les données le moment venu +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 +post.parameters.1.description = URL pour signaler que le traitement est terminé +post.parameters.1.in = header +post.parameters.1.name = X-Webhook-Success +post.parameters.1.schema.type = string +post.parameters.1.schema.format = uri +post.parameters.1.required = false +post.parameters.2.description = URL pour signaler que le traitement a échoué +post.parameters.2.in = header +post.parameters.2.name = X-Webhook-Failure +post.parameters.2.schema.type = string +post.parameters.2.schema.format = uri +post.parameters.2.required = false + +[use] +plugin = basics +plugin = analytics + +# Step 1 (générique): Charger le fichier corpus +[delegate] +file = charger.cfg + +# Step 2 (générique): Traiter de manière asynchnore les items reçus +[fork] +standalone = true +logger = logger.cfg + +# Step 2.1 (spécifique): Lancer un calcul sur tous les items reçus +[fork/validate] +path = fake path +rule = required + +# Step 2.2 (générique): Enregister le résulat et signaler que le traitment est fini +[fork/delegate] +file = recorder.cfg + +# Step 3 : Renvoyer immédiatement un seul élément indiquant comment récupérer le résulat quand il sera prêt +[shift] +[replace] +path = id +value = env('generator') +path = value +value = env('identifier') + +[JSONString] +indent = env('indent') diff --git a/data-computer/v1/mock-error-sync.ini b/data-computer/v1/mock-error-sync.ini new file mode 100644 index 0000000..86eda9a --- /dev/null +++ b/data-computer/v1/mock-error-sync.ini @@ -0,0 +1,53 @@ +# Entrypoint output format +mimeType = application/json + +# OpenAPI Documentation - JSON format (dot notation) +post.operationId = post-v1-mock-error-sync +post.description = Chargement et analyse d'un fichier corpus et simule une erreur direct d'analyse du fichier +post.summary = Simule une erreur synchrone, avant que le traitment soit lancé. +post.tags.0 = data-computer +post.requestBody.content.application/x-tar.schema.type = string +post.requestBody.content.application/x-tar.schema.format = binary +post.requestBody.required = true +post.responses.default.description = Informations permettant de récupérer les données le moment venu +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 +post.parameters.1.description = URL pour signaler que le traitement est terminé +post.parameters.1.in = header +post.parameters.1.name = X-Webhook-Success +post.parameters.1.schema.type = string +post.parameters.1.schema.format = uri +post.parameters.1.required = false +post.parameters.2.description = URL pour signaler que le traitement a échoué +post.parameters.2.in = header +post.parameters.2.name = X-Webhook-Failure +post.parameters.2.schema.type = string +post.parameters.2.schema.format = uri +post.parameters.2.required = false + +[use] +plugin = basics +plugin = analytics + +# Step 1 (générique): Charger le fichier corpus +[delegate] +file = charger.cfg + +# Step 2 (générique): Traiter de manière asynchnore les items reçus + [validate] + path = fake path + rule = required + + +# Step 3 : Renvoyer immédiatement un seul élément indiquant comment récupérer le résulat quand il sera prêt +[shift] +[replace] +path = id +value = env('generator') +path = value +value = env('identifier') + +[JSONString] +indent = env('indent')