API change: new juju scp subcommand

Jim Baker jim.baker at canonical.com
Wed Nov 30 22:13:50 UTC 2011


A proposed API change is to implement a new subcommand, juju scp. This
feature is requested by this bug:
https://bugs.launchpad.net/juju/+bug/720307

Users need a simple way to transfer files back and forth from
Juju-managed machines. Like juju ssh, machines can be identified by
their machine ID or by their service unit name. This enables command
usage like so:

Grab the wordpress configuration file in order to debug it:

 $ juju scp wordpress/0:/etc/wordpress/config-* .

Upload to machine 2 in /home/ubuntu the file some-file:

 $ juju scp some-file 2:.

The juju scp subcommand works by identifying paths that specify a
remote host; if the remote host has the format of a service unit name
(<service name>/<unit number>) or is a potential machine ID, this then
is expanded to the public DNS name for the corresponding machine.

Any options used, such as -r, are passed through to the underlying scp
command being used to do the actual copy.

Unlike the existing juju ssh, juju scp does not depend on agent
liveness. It should however depend on the ssh host keys being
registered, as part of work on managing ssh keys.

Please note, this is not intended to be a general purpose tool for
uploading files to be used by Juju. That's really the purpose of a
related feature request, https://bugs.launchpad.net/juju/+bug/814974,
to add a file type for config settings.

Merge proposal implementing this work:
https://code.launchpad.net/~jimbaker/juju/scp-command/+merge/80343


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 554 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/juju/attachments/20111130/1ac53a22/attachment.pgp>


More information about the Juju mailing list