Viewing File: /usr/lib/python2.7/site-packages/euca2ools/commands/ec2/importvolume.pyo

ó
¡ôXc@ sæddlmZddlZddlZddlZddlmZmZddlm	Z	ddl
mZddlm
Z
ddlmZddlmZdd	lmZdd
lmZddlZdeeefd„ƒYZdS(
iÿÿÿÿ(tdivisionN(tArgtMutuallyExclusiveArgList(t
ArgumentError(tFileTransferProgressBarMixin(tfilesize(t
EC2Request(t
S3AccessMixin(tResumeImport(t	GetObjecttImportVolumecB sâeZdZeddddd:ddƒeddd	d
dddedd
ƒeddd	ddddeddƒeddddd	ddeddƒedd	ddddeddƒeedddd:ddƒed d	d!dd"dd#ƒƒj	ƒed$dd:dd%ƒed&d'dd(ded)d*dd:dd+ƒed,d-d.dd:dd/ƒed0d1d	d2dd3ƒed4d-d.dd:de
jƒed5d-d.dd:de
jƒed6d-d.dd:de
jƒg
Zd7„Z
d8„Zd9„ZRS(;s&Import a file to a volume in the cloudtsourcetmetavartFILEtroute_tothelps3file containing the disk image to import (required)s-fs--formattdestsImage.FormattFORMATtrequiredsGthe image's format ("vmdk", "raw", or
                "vhd") (required)s-zs--availability-zonetAvailabilityZonetZONEs1the zone in which to create the volume (required)s-ss
--volume-sizetGiBsVolume.Sizettypes'size of the volume to import to, in GiBs--image-sizesImage.BytestBYTESs-size of the image (required for non-raw filess-bs--buckets"the bucket to upload the volume tos--manifest-urlsImage.ImportManifestUrltURLsNa pre-signed URL that points to
                    the import manifest to uses--prefixsUa prefix to add to the
                names of the volume parts as they are uploadeds-xs	--expirestDAYStdefaultis\how long the import manifest should
                remain valid, in days (default: 30 days)s--no-uploadtactiont
store_trueshstart the import process, but do not actually upload
                the volume (see euca-resume-import)s-ds
--descriptiontDescriptions2a description for the import task (not the volume)s--ignore-region-affinitys	--dry-runs--dont-verify-formatcC s€tj|ƒ|jƒ|jdjƒdkrM|jdjƒ|jd<n|jjdƒsö|jddkr›tjj|j	dƒ}||jd<qö|jddkr×tjj
|j	dƒ}||jd<qötdj|jdƒƒ‚n|jjdƒs8t
j|jddƒ}t|ƒ|jd<n|j	jdƒsZd
|j	d<n|j	ddkr|td
ƒ‚ndS(NsImage.FormattVMDKtVHDtRAWsImage.BytesRs/argument --image-size is required for {0} filessVolume.Sizeiitexpiresis-argument -x/--expires: value must be positive(RRR i@(Rt	configuretconfigure_s3_accesstparamstuppertgett	euca2oolstutiltget_filesizetargstget_vmdk_image_sizeRtformattmathtceiltint(tselft
image_sizetvol_size((sG/usr/lib/python2.7/site-packages/euca2ools/commands/ec2/importvolume.pyR"Vs.

	cC sÉ|jjdƒrdS|jjdƒr?|j|jdƒn|jjdƒs4djtjƒ|jdƒ}|jjdƒr¡dj|jd|fƒ}ntj|d|jd	d
|jdddj|jd|fƒƒ}|jjdƒpûd
}|j	|dƒ}|j
jd|ƒ||jd<n|j
ƒ}|jjdƒsÅtj|d|jdd|ddd	|jd	d|jdd|jdd|jjdtƒƒ}|jƒn|S(Ntdry_runtbucketsImage.ImportManifestUrls{0}/{1}.manifest.xmlRtprefixt/tservicet
s3_servicetauthts3_authR!ii€Qsgenerated manifest GET URL: %st	no_uploadttasktconversionTasktconversionTaskIdt
show_progress(R*R&tensure_bucket_existsR,tuuidtuuid4tjoinR	t
from_othertget_presigned_url2tlogtinfoR$tsendRtFalsetmain(R0tmanifest_keytgetobjtdaystget_urltresulttresume((sG/usr/lib/python2.7/site-packages/euca2ools/commands/ec2/importvolume.pyRJrs6


cC s|j|dƒdS(NR=(tprint_conversion_task(R0RO((sG/usr/lib/python2.7/site-packages/euca2ools/commands/ec2/importvolume.pytprint_result•sN(t__name__t
__module__tDESCRIPTIONRtNonetTrueR/RRRtargparsetSUPPRESStARGSR"RJRR(((sG/usr/lib/python2.7/site-packages/euca2ools/commands/ec2/importvolume.pyR
,sL				#(t
__future__RRXR-RAtrequestbuilderRRtrequestbuilder.exceptionsRtrequestbuilder.mixinsRteuca2ools.commands.argtypesRteuca2ools.commands.ec2Rteuca2ools.commands.ec2.mixinsRt#euca2ools.commands.ec2.resumeimportRteuca2ools.commands.s3.getobjectR	teuca2ools.utilR'R
(((sG/usr/lib/python2.7/site-packages/euca2ools/commands/ec2/importvolume.pyt<module>s
Back to Directory File Manager