58 lines
1.7 KiB
YAML
58 lines
1.7 KiB
YAML
mail:
|
|
host: localhost:25
|
|
|
|
directories:
|
|
- path: /tmp/foo
|
|
recursive: false
|
|
events: ["CLOSE_WRITE", "MOVED_TO"]
|
|
pollingInterval: 60
|
|
regex: "/[^\\.][^/]+.xml$"
|
|
ignoreMissing: true
|
|
actions:
|
|
- id: postXML
|
|
description: POST xml
|
|
type: http
|
|
method: post
|
|
url: http://localhost:8080/api/v1/_/renz_einfo/xml
|
|
header:
|
|
Token: Ksi02vcaHHasd1sjYxiq4J
|
|
ContentType: application/xml
|
|
# content: PLAIN IS FILECONTENT
|
|
onError:
|
|
- id: moveXMLError
|
|
description: MOVE xml to error dir
|
|
type: move
|
|
to: /tmp/error/{{ filename }}
|
|
- id: mailXMLError
|
|
description: eInfo Import ERROR on POST xml
|
|
type: mail
|
|
to: sebastian@webmakers.de
|
|
subject: "{{ action.Description }}"
|
|
body: |
|
|
path: {{ path }}
|
|
event: {{ event }}
|
|
|
|
http status: {{ context.postXML.response.Status }}
|
|
|
|
http response body
|
|
------------------
|
|
{{ context.postXML.response.Body }}
|
|
|
|
from: noreply@webmakers.de
|
|
stop: true
|
|
|
|
onSuccess:
|
|
- id: deleteXML
|
|
description: DELETE xml after POST
|
|
type: delete
|
|
|
|
- path: /tmp/foo
|
|
recursive: false
|
|
events: ["CLOSE_WRITE", "MOVED_TO"]
|
|
regex: "/(\\d{2})(\\d{2})(\\d{2})[^/]*.(png|jpe?g|pdf)$"
|
|
actions:
|
|
- type: log
|
|
content: "{{ filename }} {{ regexMatches.1 }} {{ regexMatches.2 }} {{ regexMatches.3 }} {{ regexMatches.4 }}"
|
|
- type: mkdir
|
|
path: /tmp/testdir/{{ regexMatches.1 }}/{{ regexMatches.2 }}/{{ regexMatches.3 }}/{{ regexMatches.4 }}
|