%PDF- %PDF-
Direktori : /lib/python2.7/site-packages/salt/modules/ |
Current File : //lib/python2.7/site-packages/salt/modules/boto_cognitoidentity.pyc |
� ���^c @@ s� d Z d d l m Z m Z m Z d d l Z d d l Z d d l Z e j e � Z yd d d l Z d d l Z d d l m Z e j d � j e j � e j d � j e j � e Z Wn e k r� e Z n Xd � Z d � Z d � Z d d d d d d � Z e d d d d d d d d � Z d d d d d d � Z d d d d d d � Z d � Z d d d d d d d � Z d e d d d d d d d d � Z d S( u Connection module for Amazon CognitoIdentity .. versionadded:: 2016.11.0 :configuration: This module accepts explicit CognitoIdentity credentials but can also utilize IAM roles assigned to the instance trough Instance Profiles. 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 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 cognitoidentity.keyid: GKTADJGHEIQSXMKKRBJ08H cognitoidentity.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs A region may also be specified in the configuration: .. code-block:: yaml cognitoidentity.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 .. versionchanged:: 2015.8.0 All methods now return a dictionary. Create, delete, set, and update methods return: .. code-block:: yaml created: true or .. code-block:: yaml created: false error: message: error message Request methods (e.g., `describe_identity_pools`) return: .. code-block:: yaml identity_pools: - {...} - {...} or .. code-block:: yaml error: message: error message :depends: boto3 i ( t absolute_importt print_functiont unicode_literalsN( t ClientErroru botou boto3c C@ s t j j j d d d d � S( ug Only load if boto libraries exist and if boto libraries are greater than a given version. t boto_veru 2.8.0t boto3_veru 1.2.1( t saltt utilst versionst check_boto_reqs( ( ( sE /usr/lib/python2.7/site-packages/salt/modules/boto_cognitoidentity.pyt __virtual__j s c C@ s1 t j j j t � t r- t d t d � n d S( Nu boto3.assign_funcsu cognito-identity( R R t compatt pack_dundert __name__t HAS_BOTOt __utils__( t opts( ( sE /usr/lib/python2.7/site-packages/salt/modules/boto_cognitoidentity.pyt __init__x s c C@ s� g } | d k r~ xv t d | j d d d d d d �D]? } x6 | d D]* } | d | k rI | j | d � qI qI Wq8 Wn | j | � | S( u� Given identity pool name (or optionally a pool_id and name will be ignored), find and return list of matching identity pool id's. u boto3.paged_callt marker_flagu NextTokent marker_argt MaxResultsi u IdentityPoolsu IdentityPoolNameu IdentityPoolIdN( t NoneR t list_identity_poolst append( t namet pool_idt connt idst poolst pool( ( sE /usr/lib/python2.7/site-packages/salt/modules/boto_cognitoidentity.pyt _find_identity_pool_ids~ s c C@ s� t d | d | d | d | � } yx t | | | � } | r� g } x= | D]5 } | j d | � } | j d d � | j | � qI Wi | d 6Si d d 6SWn% t k r� } i t d | � d 6SXd S( u� Given an identity pool name, (optionally if an identity pool id is given, the given name will be ignored) Returns a list of matched identity pool name's pool properties CLI Example: .. code-block:: bash salt myminion boto_cognitoidentity.describe_identity_pools my_id_pool_name salt myminion boto_cognitoidentity.describe_identity_pools '' IdentityPoolId=my_id_pool_id t regiont keyt keyidt profilet IdentityPoolIdu ResponseMetadatau identity_poolsu boto3.get_erroru errorN( t _get_connR t describe_identity_poolt popR R R R ( t IdentityPoolNameR# R R R! R"