%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/modules/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/modules/boto_s3.pyc

�
���^c@@s�dZddlmZmZmZddlZddlZeje	�Z
y;ddlZddlZejd�j
ej�eZWnek
r�eZnXd�Zd�Zdddddd�Zdddddd�ZdS(	u�
Connection module for Amazon S3 using boto3

.. versionadded:: 2018.3.0

:configuration: This module accepts explicit AWS credentials but can also
    utilize IAM roles assigned to the instance through Instance Profiles or
    it can read them from the ~/.aws/credentials file or from these
    environment variables: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY.
    Dynamic credentials are then automatically obtained from AWS API and no
    further configuration is necessary. More information available at:

    .. code-block:: text

        http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/
            iam-roles-for-amazon-ec2.html

        http://boto3.readthedocs.io/en/latest/guide/
            configuration.html#guide-configuration

    If IAM roles are not used you need to specify them either in a pillar or
    in the minion's config file:

    .. code-block:: yaml

        s3.keyid: GKTADJGHEIQSXMKKRBJ08H
        s3.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs

    A region may also be specified in the configuration:

    .. code-block:: yaml

        s3.region: us-east-1

    If a region is not specified, the default is us-east-1.

    It's also possible to specify key, keyid and region via a profile, either
    as a passed in dict, or as a string to pull from pillars or minion config:

    .. code-block:: yaml

        myprofile:
            keyid: GKTADJGHEIQSXMKKRBJ08H
            key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
            region: us-east-1

:depends: boto3
i(tabsolute_importtprint_functiontunicode_literalsNuboto3cC@stjjjdd�S(ug
    Only load if boto libraries exist and if boto libraries are greater than
    a given version.
    t	boto3_veru1.2.1(tsalttutilstversionstcheck_boto_reqs(((s8/usr/lib/python2.7/site-packages/salt/modules/boto_s3.pyt__virtual__KscC@strtdtd�ndS(Nuboto3.assign_funcsus3(tHAS_BOTOt	__utils__t__name__(topts((s8/usr/lib/python2.7/site-packages/salt/modules/boto_s3.pyt__init__Usc	C@s�|jd�\}}}|dkr-i}ntd|d|d|d|�}	y|	jd|d||�}
WnMtjjk
r�}|jdd	d
kr�idd6Sitd|�d
6SXi|
d6S(u�
    Get metadata about an S3 object.
    Returns None if the object does not exist.

    You can pass AWS SSE-C related args and/or RequestPayer in extra_args.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_s3.get_object_metadata \
                         my_bucket/path/to/object \
                         region=us-east-1 \
                         key=key \
                         keyid=keyid \
                         profile=profile \
    u/tregiontkeytkeyidtprofiletBuckettKeyuErroruMessageu	Not Founduresultuboto3.get_erroruerrorN(	t	partitiontNonet	_get_connthead_objecttbotocoret
exceptionstClientErrortresponseR
(tnamet
extra_argsRRRRtbuckett_ts3_keytconntmetadatate((s8/usr/lib/python2.7/site-packages/salt/modules/boto_s3.pytget_object_metadataZs	!	
c	C@s�|jd�\}}}	td|d|d|d|�}
y|
j|||	d|�Wn+tjjk
r�}itd|�d6SXtjd	|�it	d
6S(u�
    Upload a local file as an S3 object.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_s3.upload_file \
                         /path/to/local/file \
                         my_bucket/path/to/object \
                         region=us-east-1 \
                         key=key \
                         keyid=keyid \
                         profile=profile \
    u/RRRRt	ExtraArgsuboto3.get_erroruerroruS3 object uploaded to %suresult(
RRtupload_filetboto3RtS3UploadFailedErrorR
tlogtinfotTrue(tsourceRRRRRRRRR R!R#((s8/usr/lib/python2.7/site-packages/salt/modules/boto_s3.pyR&�s!(t__doc__t
__future__RRRtloggingtsalt.utils.versionsRt	getLoggerRR)R'RtsetLeveltCRITICALR+R	tImportErrortFalseRR
RR$R&(((s8/usr/lib/python2.7/site-packages/salt/modules/boto_s3.pyt<module>1s.


	
	*

Zerion Mini Shell 1.0