[pkg-eucalyptus-commits] [euca2ools] 09/41: Implement CopyImage

Charles Plessy plessy at alioth.debian.org
Sat Oct 12 03:24:12 UTC 2013


This is an automated email from the git hooks/post-receive script.

plessy pushed a commit to branch master
in repository euca2ools.

commit 75c20a020c96dce9f326c2c0d751c7d9b3c1f0c8
Author: Garrett Holmstrom <gholms at fedoraproject.org>
Date:   Tue Jul 9 16:25:01 2013 -0700

    Implement CopyImage
    
    Fixes TOOLS-341
---
 bin/euca-copy-image                  |    6 ++++
 euca2ools/commands/euca/copyimage.py |   47 ++++++++++++++++++++++++++++
 man/euca-copy-image.1                |   56 ++++++++++++++++++++++++++++++++++
 3 files changed, 109 insertions(+)

diff --git a/bin/euca-copy-image b/bin/euca-copy-image
new file mode 100755
index 0000000..e3c43b1
--- /dev/null
+++ b/bin/euca-copy-image
@@ -0,0 +1,6 @@
+#!/usr/bin/python -tt
+
+import euca2ools.commands.euca.copyimage
+
+if __name__ == '__main__':
+    euca2ools.commands.euca.copyimage.CopyImage.run()
diff --git a/euca2ools/commands/euca/copyimage.py b/euca2ools/commands/euca/copyimage.py
new file mode 100644
index 0000000..912f934
--- /dev/null
+++ b/euca2ools/commands/euca/copyimage.py
@@ -0,0 +1,47 @@
+# Copyright 2013 Eucalyptus Systems, Inc.
+#
+# Redistribution and use of this software in source and binary forms,
+# with or without modification, are permitted provided that the following
+# conditions are met:
+#
+#   Redistributions of source code must retain the above copyright notice,
+#   this list of conditions and the following disclaimer.
+#
+#   Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from euca2ools.commands.euca import EucalyptusRequest
+from requestbuilder import Arg
+
+
+class CopyImage(EucalyptusRequest):
+    DESCRIPTION = ('Copy an image from another region\n\nRun this command '
+                   'against the destination region, not the source region.')
+    ARGS = [Arg('-r', '--source-region', dest='SourceRegion', metavar='REGION',
+                required=True,
+                help='name of the region to copy the image from (required)'),
+            Arg('-s', '--source-ami-id', dest='SourceImageId', metavar='IMAGE',
+                required=True,
+                help='ID of the image to copy (required)'),
+            Arg('-n', '--name', dest='Name',
+                help='name to assign the new copy of the image'),
+            Arg('-d', '--description', dest='Description', metavar='DESC',
+                help='description to assign the new copy of the image'),
+            Arg('-c', '--client-token', dest='ClientToken', metavar='TOKEN',
+                help='unique identifier to ensure request idempotency')]
+
+    def print_result(self, result):
+        print self.tabify(('IMAGE', result.get('imageId')))
diff --git a/man/euca-copy-image.1 b/man/euca-copy-image.1
new file mode 100644
index 0000000..4eb5689
--- /dev/null
+++ b/man/euca-copy-image.1
@@ -0,0 +1,56 @@
+.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.41.2.
+.TH EUCA-COPY-IMAGE "1" "July 2013" "euca2ools 3.0.0" "User Commands"
+.SH NAME
+euca-copy-image \- Copy an image from another region
+.SH SYNOPSIS
+euca\-copy\-image \fB\-r\fR REGION \fB\-s\fR IMAGE [\-n NAME] [\-d DESC] [\-c TOKEN]
+[\-\-show\-empty\-fields] [\-\-region USER at REGION | \fB\-U\fR URL]
+[\-I KEY_ID] [\-S KEY] [\-\-debug] [\-\-debugger] [\-\-version]
+[\-h]
+.SH DESCRIPTION
+Copy an image from another region
+.SH DESCRIPTION
+Run this command against the destination region, not the source
+region.
+.SS "optional arguments:"
+.TP
+\fB\-r\fR REGION, \fB\-\-source\-region\fR REGION
+name of the region to copy the image from (required)
+.TP
+\fB\-s\fR IMAGE, \fB\-\-source\-ami\-id\fR IMAGE
+ID of the image to copy (required)
+.TP
+\fB\-n\fR NAME, \fB\-\-name\fR NAME
+name to assign the new copy of the image
+.TP
+\fB\-d\fR DESC, \fB\-\-description\fR DESC
+description to assign the new copy of the image
+.TP
+\fB\-c\fR TOKEN, \fB\-\-client\-token\fR TOKEN
+unique identifier to ensure request idempotency
+.TP
+\fB\-\-show\-empty\-fields\fR
+show empty values as "(nil)"
+.TP
+\fB\-\-region\fR USER at REGION
+name of the region and/or user in config files to use
+to connect to the service
+.TP
+\fB\-U\fR URL, \fB\-\-url\fR URL
+compute service endpoint URL
+.HP
+\fB\-I\fR KEY_ID, \fB\-\-access\-key\-id\fR KEY_ID
+.HP
+\fB\-S\fR KEY, \fB\-\-secret\-key\fR KEY
+.TP
+\fB\-\-debug\fR
+show debugging output
+.TP
+\fB\-\-debugger\fR
+launch interactive debugger on error
+.TP
+\fB\-\-version\fR
+show the program's version and exit
+.TP
+\fB\-h\fR, \fB\-\-help\fR
+show this help message and exit

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-eucalyptus/euca2ools.git



More information about the pkg-eucalyptus-commits mailing list