Call HTTP url on events : start, done

#1

What is the problem?
I Need to call an http on events start and done

What did you already try to solve it?
I have searched inside all plugin, none seems to do what i need

Many thanks for your help, is there a modification i can make to do this ?

#2

Here are the two events you're interested in. As described above this in the configuration section...

config.yaml:

events:
  enabled: True
  subscriptions:
  - event: PrintStarted
    command: ~/scripts/print-started {file}
    type: system
  - event: PrintDone
    command: ~/scripts/print-done {file}
    type: system

~/scripts/print-started:

#!/bin/sh

curl http://someserver.com/api/print-started/$1

...and don't forget to chmod the script(s) so that they're executable.

#3

That example script is a shell script, not a python script, but you are opening it with python.

1 Like
#4

Ah, yes. (More coffee.) I edited it slightly above.

#5

Many thanks for your help :slight_smile:

1 Like