File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/boto_apigateway.cpython-310.pyc
Back
o ;j� � @ s d Z ddlZddlZddlZddlZddlZe�e�Z z*ddl Z ddlZddlm Z ddlmZ e�d��ej� e�d��ej� dZW n eyP dZY nw d d � Zdd� Zd d� Zdd� Zdd� Zdd� Z d�dd�Z d�dd�Zd�dd�Z d�dd�Zd�dd�Zd�dd �Z d�d!d"�Z! d�d#d$�Z" d�d%d&�Z# d�d'd(�Z$d�d)d*�Z%d�d+d,�Z& d�d-d.�Z'd�d/d0�Z(d1d2� Z)d3d4� Z*d5d6� Z+d7d8� Z, d�d9d:�Z-d�d;d<�Z.d�d=d>�Z/ d�d?d@�Z0 d�dAdB�Z1 d�dCdD�Z2 d�dEdF�Z3 d�dGdH�Z4 I I J d�dKdL�Z5 d�dMdN�Z6 d�dOdP�Z7 d�dQdR�Z8 d�dSdT�Z9 I J d�dUdV�Z: d�dWdX�Z; d�dYdZ�Z< d�d[d\�Z= d�d]d^�Z> d�d_d`�Z? d�dadb�Z@ d�dcdd�ZA d�dedf�ZBd�dgdh�ZC d�didj�ZD d�dkdl�ZEdmdn� ZF d�dodp�ZG d�dqdr�ZH s d�dtdu�ZI d�dvdw�ZJ d�dxdy�ZK d�dzd{�ZL d�d|d}�ZMd�d~d�ZN d�d�d��ZO d�d�d��ZPd�d�� ZQ d�d�d��ZRd�d�� ZSd�d�� ZT d�d�d��ZU d�d�d��ZVd�d�d��ZW d�d�d��ZX d�d�d��ZY d�d�d��ZZdS )�a Connection module for Amazon APIGateway .. versionadded:: 2016.11.0 :depends: - boto >= 2.8.0 - boto3 >= 1.2.1 - botocore >= 1.4.49 :configuration: This module accepts explicit Lambda 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 apigateway.keyid: GKTADJGHEIQSXMKKRBJ08H apigateway.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs A region may also be specified in the configuration: .. code-block:: yaml apigateway.region: us-west-2 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-west-2 .. versionchanged:: 2015.8.0 All methods now return a dictionary. Create and delete methods return: .. code-block:: yaml created: true or .. code-block:: yaml created: false error: message: error message Request methods (e.g., ``describe_apigateway``) return: .. code-block:: yaml apigateway: - {...} - {...} or .. code-block:: yaml error: message: error message � N)�__version__)�ClientError�boto�boto3TFc C s t jjjdddd�S )zg Only load if boto libraries exist and if boto libraries are greater than a given version. z2.8.0z1.2.1z1.4.49)Zboto_verZ boto3_verZbotocore_ver)�salt�utilsZversionsZcheck_boto_reqs� r r �P/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/boto_apigateway.py�__virtual__n s �r c C s t rtd td� d S d S )Nzboto3.assign_funcsZ apigateway)�HAS_BOTO� __utils__�__name__)�optsr r r �__init__{ s �r c C s | r t dd� | �� D ��S dS )zQ modify any key-value pair where value is a datetime object to a string. c S s. g | ]\}}t |tj�r||� fn||f�qS r )� isinstance�datetime�date)�.0�k�vr r r � <listcomp>� s ��z)_convert_datetime_str.<locals>.<listcomp>N)�dict�items)�responser r r �_convert_datetime_str� s ��r c � � fdd�|D �S )z; Return list of api items matching the given name. c � g | ] }|d � kr|�qS ��namer �r �apir r r r � � z _filter_apis.<locals>.<listcomp>r )r �apisr r r �_filter_apis� � r# c r )zB Return list of api items matching the given description. c r )�descriptionr r ��descr r r � r! z%_filter_apis_desc.<locals>.<listcomp>r )r'