From aeb5fc932d9c2f98c3a49ce260a4cbdbb2886b7c Mon Sep 17 00:00:00 2001 From: Dominik Chilla Date: Mon, 14 Jan 2019 19:47:01 +0100 Subject: [PATCH] Bounce QuarMail is now a POST --- README.md | 19 +++++++++++++++++-- app/Resources.py | 2 +- gulag-openapi-2.0.yaml | 2 +- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index bed1730..0559d77 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Gulag quarantine ## get all QuarMail metadata -``` +``` curl -v -s http://127.0.0.1:9090/api/v1/quarmails | jq ``` @@ -18,6 +18,11 @@ curl -v -s http://127.0.0.1:9090/api/v1/quarmails?rfc822_message=1 | jq curl -v -s -G --data-urlencode 'filters={"groupOp":"OR","rules":[{"field":"hdr_subject","op":"eq","data":"996 test from quar mit sync xyz"}]}' http://127.0.0.1:9090/api/v1/quarmails | jq ``` +## update a QuarMail´s metadata (e.g. sandbox_results) by ID +``` + curl -v -s -X PATCH -d '{"sandbox_results":"12345abc"}' http://127.0.0.1:9090/api/v1/quarmails/311|jq +``` + ## delete a QuarMail by ID ``` curl -v -s -X DELETE http://127.0.0.1:9090/api/v1/quarmails/141 | jq @@ -29,10 +34,20 @@ curl -v -s http://127.0.0.1:9090/api/v1/quarmails?rfc822_message=1 | jq ``` ## get a QuarMail´s metadata by ID + RFC822 message -``` +``` curl -v -s http://127.0.0.1:9090/api/v1/quarmails/136?rfc822_message=1 | jq ``` +## get a QuarMail´s metadata by ID + RFC822 message headers +``` + curl -v -s http://127.0.0.1:9090/api/v1/quarmails/136?headers=1 | jq +``` + +## Bounce QuarMail by ID +``` + curl -v -s -X POST http://127.0.0.1:9090/api/v1/quarmails/136/bounce | jq +``` + ## get all URIs of a QuarMail ``` curl -v -s http://127.0.0.1:9090/api/v1/quarmails/136/uris | jq diff --git a/app/Resources.py b/app/Resources.py index 3036068..825195d 100644 --- a/app/Resources.py +++ b/app/Resources.py @@ -110,7 +110,7 @@ class ResQuarMailRelease(GulagResource): abort(500, message=whoami(self)+e.message) class ResQuarMailBounce(GulagResource): - def get(self,quarmail_id): + def post(self,quarmail_id): args = {"quarmail_id": quarmail_id} if(request.args.get('purge')): args['purge'] = True diff --git a/gulag-openapi-2.0.yaml b/gulag-openapi-2.0.yaml index 726cb7f..9771bde 100644 --- a/gulag-openapi-2.0.yaml +++ b/gulag-openapi-2.0.yaml @@ -260,7 +260,7 @@ paths: 500: description: server error /quarmails/{quarmail_id}/bounce: - get: + post: summary: bounces a quarantined email by quarmail_id operationId: bounce_quarmail produces: