Current File : //usr/lib/python2.7/site-packages/euca2ools/commands/s3/postobject.pyo
�
��Xc@s�ddlZddlZddlZddlmZmZddlmZddlZddl	m
Z
ddlmZdefd��YZ
dS(i����N(tArgtMutuallyExclusiveArgList(t
ArgumentError(tb64encoded_file_contents(t	S3Requestt
PostObjectcBsUeZdZd.Zeddddd.dd�eddddd.dd	�eed
ddddd
ejdd�edddddd
e	dd��j
�eddddedd�edddddedddd�eddddej
dej
�eddej
dd/dd'�ed(dd)dej
dd*�gZd+Zd,�Zd-�ZRS(0s�Upload an object to the server using an upload policy

Note that uploading a large file to a region other than the one the bucket is may result in "Broken pipe" errors or other connection problems that this program cannot detect.tsourcetmetavartFILEtroute_tothelpsfile to upload (required)tdests
BUCKET/KEYs6bucket and key name to upload the object to (required)s--policytPolicytPOLICYttypes&upload policy to use for authorizations
--policy-filesNfile containing the
                    upload policy to use for authorizations--policy-signaturet	Signaturetrequireds*signature for the upload policy (required)s-Is--access-key-idtAWSAccessKeyIdtKEY_IDsMID of the access key that signed the
                upload policy (required)s--security-tokensx-amz-security-tokentdefaults--acltchoicestprivatespublic-readspublic-read-writesauthenticated-readsbucket-owner-readsbucket-owner-full-controls
aws-exec-readsec2-bundle-reads�the ACL the object should have
                once uploaded.  Take care to ensure this satisfies any
                restrictions the upload policy may contain.s--mime-typesContent-Types%MIME type for the file being uploadedtPOSTcCs�tj|�|jddkr3tj|jd<nJt|jdtj�rit	|jd�|jd<n|jd|jd<|jdj
d�\}}}|s�td��n|s�td��ndS(NRt-tfileRt/s)destination bucket name must be non-emptys&destination key name must be non-empty(Rt	configuretargstsyststdintfilest
isinstancetsixtstring_typestopent	partitionR(tselftbuckett_tkey((sD/usr/lib/python2.7/site-packages/euca2ools/commands/s3/postobject.pyRPs
cCsB|jdjd�\|_}|jd<|j|_d|_dS(NRRR'(RR#tpathtparamstbodytNone(R$R&((sD/usr/lib/python2.7/site-packages/euca2ools/commands/s3/postobject.pyt
preprocess`s
)N(Rspublic-readspublic-read-writesauthenticated-readsbucket-owner-readsbucket-owner-full-controls
aws-exec-readsec2-bundle-read(t__name__t
__module__tDESCRIPTIONR+t
AUTH_CLASSRRtbase64t	b64encodeRRtTruetargparsetSUPPRESStARGStMETHODRR,(((sD/usr/lib/python2.7/site-packages/euca2ools/commands/s3/postobject.pyR&s>		(R4R1RtrequestbuilderRRtrequestbuilder.exceptionsRR teuca2ools.commands.argtypesRteuca2ools.commands.s3RR(((sD/usr/lib/python2.7/site-packages/euca2ools/commands/s3/postobject.pyt<module>s