The docs describe a "snapshot" action, which backs up a database. I have used something similar but I was wondering, once that snapshot does create a file (in my case a postgresql dump) it just sits there on the machine for that particular charm. Is there not some way of passing it back to machine from where you run the "juju run-action ..." command from in the first place? (I'm not sure of the terminology here, so I'm just going to call it the "host")
I'm using python, and I know you can use hookenv.action_set({}) to pass a message back, but what about a whole file? I suppose I could use this to pass the contents of the file back, but it seems a bit hacky.
If I use something like:
host_ip, _, machine_ip, __ = os.environ['SSH_CONNECTION'].split(' ')
and then try to scp the file using the host_ip information, it wants a password, so isn't really automated.
Does anyone have any suggestions for doing this from within an action please?