File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/boto_kinesis.cpython-310.pyc
Back
o ;jwN � @ s4 d Z ddlZddlZddlZddlZzddlZddlZe�d�� ej � dZW n ey2 dZY nw e�e �ZdZdd� Zd d � Zd+dd�Z d+d d�Zd+dd�Z d+dd�Zd+dd�Z d+dd�Z d+dd�Z d+dd�Z d+dd�Zdd� Zdd � Z d,d!d"�Zd+d#d$�Zd%d&� Zd'd(� Z d)d*� Z!dS )-a� Connection module for Amazon Kinesis .. versionadded:: 2017.7.0 :configuration: This module accepts explicit Kinesis 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 kinesis.keyid: GKTADJGHEIQSXMKKRBJ08H kinesis.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs A region may also be specified in the configuration: .. code-block:: yaml kinesis.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 � N�boto3TFZboto_kinesisc C s* t jj�� } | du rtd td� tS | S )z- Only load if boto3 libraries exist. Tzboto3.assign_funcsZkinesis)�salt�utilsZversionsZcheck_boto_reqsZ __utils__�__name__�__virtualname__)Z has_boto_reqs� r �M/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/boto_kinesis.py�__virtual__G s r c C s t |d| d�S )a Stream info from AWS, via describe_stream Only returns the first "page" of shards (up to 100); use _get_full_stream() for all shards. CLI Example: .. code-block:: bash salt myminion boto_kinesis._get_basic_stream my_stream existing_conn �describe_stream�� StreamName)�_execute_with_retries)�stream_name�connr r r �_get_basic_streamR s r c C s� t ||||d�}i }t| |�d }|}|d d rAt|d| |d d d d d �}|d }|d d |d d 7 <