%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_apigateway.pyc

�
���^c
@@s�dZddlmZmZmZddlZddlZddlmZddl	Z
ddlZ
ddlZ
ej
e�ZytddlZddlZddlmZddlmZej
d�jej�ej
d�jej�eZWnek
r
eZnXd	�Zd
�Zd�Zd�Z d
�Z!d�Z"dddddd�Z$ddddddd�Z%dddddd�Z&dddddd�Z'dddddd�Z(ddddd�Z)ddddd�Z*ddddd�Z+ddddd�Z,ddddd�Z-ddddd�Z.ddddd�Z/edddddd�Z0ddddd�Z1d�Z2d�Z3d�Z4d �Z5ddddd!�Z6ddddd"�Z7ddddd#�Z8ddddd$�Z9ddddd%�Z:ddddd&�Z;ddddd'�Z<ddddd(�Z=d)d)ed*dddddd+�	Z>ddddd,�Z?ddddd-�Z@ddddd.�ZAddddd/�ZBd)ed*dddddd0�ZCddddd1�ZDddddd2�ZEeddddddd3�ZFddddd4�ZGddddd5�ZHddddddd6�ZIddddd7�ZJddddd8�ZKddddd9�ZLeddddd:�ZMddddd;�ZNd<�ZOddddd=�ZPddddd>�ZQd?ddddd@�ZRdddddA�ZSdddddB�ZTdddddC�ZUdddddD�ZVdddddE�ZWdddddddF�ZXdddddddG�ZYdH�ZZdddddddI�Z[dJ�Z\dK�Z]ddddddddL�Z^dddddddM�Z_dddddN�Z`dddddO�ZadddddP�ZbdddddQ�ZcdS(Ru
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

i(tabsolute_importtprint_functiontunicode_literalsN(tsix(tClientError(t__version__ubotouboto3cC@s"tjjjdddddd�S(ug
    Only load if boto libraries exist and if boto libraries are greater than
    a given version.
    tboto_veru2.8.0t	boto3_veru1.2.1tbotocore_veru1.4.49(tsalttutilstversionstcheck_boto_reqs(((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pyt__virtual__pscC@s1tjjjt�tr-tdtd�ndS(Nuboto3.assign_funcsu
apigateway(R	R
tcompattpack_dundert__name__tHAS_BOTOt	__utils__(topts((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pyt__init__scC@sc|r_tgtj|�D]?\}}t|tj�rL|dj|�fn	||f^q�SdS(uQ
    modify any key-value pair where value is a datetime object to a string.
    u{0}N(tdictRt	iteritemst
isinstancetdatetimetdatetformattNone(tresponsetktv((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pyt_convert_datetime_str�sYcC@s'g|D]}|d|kr|^qS(u;
    Return list of api items matching the given name.
    uname((tnametapistapi((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pyt_filter_apis�scC@s'g|D]}|d|kr|^qS(uB
    Return list of api items matching the given description.
    udescription((tdescR!R"((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pyt_filter_apis_desc�scO@sq|||�}|jd�}xC|rc|d|||�}||j||�|jd�}q!W|j|�S(u�
    Retrieve full list of values for the contentkey from a boto3 ApiGateway
    client function that may be paged via 'position'
    upositiontposition(tgettextend(tfunctiont
contentkeytargstkwargstretR&tmore((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pyt_multi_call�s	c
	C@s�y�td|d|d|d|�}t|jd�}|rNt||�}n|d	k	rlt||�}nig|D]}t|�^qvd6SWn%tk
r�}	itd|	�d6SXd	S(
u�
    get and return list of matching rest api information by the given name and desc.
    If rest api name evaluates to False, return all apis w/o filtering the name.
    tregiontkeytkeyidtprofileuitemsurestapiuboto3.get_erroruerrorN(	t	_get_connR/t
get_rest_apisR#RR%RRR(
R tdescriptionR0R1R2R3tconnR!R"te((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pyt_find_apis_by_name�s!(cC@sZ|r.t|d|d|d|d|d|�Stdd|d|d|d|d|�SdS(u�
    Returns all rest apis in the defined region.  If optional parameter name is included,
    returns all rest apis matching the name in the defined region.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.describe_apis

        salt myminion boto_apigateway.describe_apis name='api name'

        salt myminion boto_apigateway.describe_apis name='api name' description='desc str'

    R6R0R1R2R3uN(R9(R R6R0R1R2R3((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pyt
describe_apis�s
cC@sDt|d|d|d|d|d|�}it|jd��d6S(u�
    Check to see if the given Rest API Name and optionally description exists.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.exists myapi_name

    R6R0R1R2R3urestapiuexists(R9tboolR'(R R6R0R1R2R3R!((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pyt
api_exists�sc
	C@s�y�td|d|d|d|�}|rK|jd|d|d|�}n|jd|d|�}t|�}|r�itd6|d	6Sitd6SWn,tk
r�}	itd6td
|	�d6SXdS(
u0
    Create a new REST API Service with the given name

    Returns {created: True} if the rest api was created and returns
    {created: False} if the rest api was not created.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.create_api myapi_name api_description

    R0R1R2R3R R6t	cloneFromucreatedurestapiuboto3.get_erroruerrorN(R4tcreate_rest_apiRtTruetFalseRR(
R R6R=R0R1R2R3R7R"R8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pyt
create_api�s!!'c	C@s�y�td|d|d|d|�}t|d||�}|jd�}|r�t|�}	x"|D]}
|	jd|
d�qaWitd	6t|�d
6Sitd	6SWn,tk
r�}itd	6t	d|�d6SXd
S(u�
    Delete all REST API Service with the given name and an optional API description

    Returns {deleted: True, count: deleted_count} if apis were deleted, and
    returns {deleted: False} if error or not found.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.delete_api myapi_name

        salt myminion boto_apigateway.delete_api myapi_name description='api description'

    R0R1R2R3R6urestapit	restApiIduidudeleteducountuboto3.get_erroruerrorN(
RR9R'R4tdelete_rest_apiR?tlenR@RR(R R6R0R1R2R3tconn_paramstrR!R7R"R8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pyt
delete_apis!
c	C@s�yWtd|d|d|d|�}tt|jdd|�dd��}i|d6SWn%tk
r~}itd	|�d
6SXdS(u�
    Given rest api id, return all resources for this api.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.describe_api_resources myapi_id

    R0R1R2R3uitemsRBcS@s|dS(Nupath((R((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pyt<lambda>.su	resourcesuboto3.get_erroruerrorN(R4tsortedR/t
get_resourcesRR(RBR0R1R2R3R7t	resourcesR8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytdescribe_api_resources s!c	
C@szt|d|d|d|d|�}|jd�}|dkrC|Sx)|D]!}|d|krJi|d6SqJWidd6S(	u�
    Given rest api id, and an absolute resource path, returns the resource id for
    the given path.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.describe_api_resource myapi_id resource_path

    R0R1R2R3u	resourcesupathuresourceN(RLR'R(	RBtpathR0R1R2R3RFRKtresource((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytdescribe_api_resource5s
$
cC@sZ|jd�}g}d}ytd|d|d|d|�}	x�|D]�}
|dkrmdj||
�}ndj||
�}t||d|d|d|d|�}|jd	�}|s�|	jd
|d|dd
d|
�}n|j|�qFW|ritd6|d6|d6Sitd6dd6SWn,t	k
rU}
itd6t
d|
�d6SXdS(u 
    Given rest api id, and an absolute resource path, create all the resources and
    return all resources in the resourcepath, returns False on failure.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.create_api_resources myapi_id resource_path

    u/uR0R1R2R3u{0}{1}u{0}/{1}uresourceRBtparentIdi����uidtpathPartucreatedu	restApiIdu	resourcesuunexpected error.uerroruboto3.get_errorN(tsplitR4RROR'tcreate_resourcetappendR?R@RR(RBRMR0R1R2R3t
path_partstcreatedtcurrent_pathR7t	path_partRFRNR8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytcreate_api_resourcesLs(
!
)c
C@s�|dkritd6dd6Sy�td|d|d|d|�}t||d|d|d|d|�}|jd	�}|r�|jd
|d|d�itd6Sitd6d
j|�d6SWn,tk
r�}	itd6td|	�d6SXdS(ud
    Given restApiId and an absolute resource path, delete the resources starting
    from the absolute resource path. If resourcepath is the root resource '/',
    the function will return False. Returns False on failure.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.delete_api_resources myapi_id, resource_path

    u/udeletedu*use delete_api to remove the root resourceuerrorR0R1R2R3uresourceRBt
resourceIduiduno resource found by {0}ucreateduboto3.get_errorN(	R@R4ROR'tdelete_resourceR?RRR(
RBRMR0R1R2R3R7RFRNR8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytdelete_api_resourcesrs!'cC@s�t||d|d|d|d|�}|jd�}|sGidd6SyRtd|d|d|d|�}	|	jd|d	|d
d|�}
i|
d6SWn%tk
r�}itd
|�d6SXdS(uu
    Given rest api id, resource path, and http method (must be one of DELETE,
    GET, HEAD, OPTIONS, PATCH, POST, PUT), return the method for the
    api/resource path if defined.  Return False if method is not defined.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.describe_api_resource_method myapi_id resource_path httpmethod

    R0R1R2R3uresourceuno such resourceuerrorRBRZuidt
httpMethodumethoduboto3.get_errorN(ROR'R4t
get_methodRR(RBtresourcePathR]R0R1R2R3RFRNR7tmethodR8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytdescribe_api_resource_method�s!"c	C@styHtd|d|d|d|�}|jd|�}it|�d6SWn%tk
ro}itd|�d6SXd	S(
u�
    Gets info about the given api key

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.describe_api_key apigw_api_key

    R0R1R2R3tapiKeyuapiKeyuboto3.get_erroruerrorN(R4tget_api_keyRRR(RbR0R1R2R3R7RR8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytdescribe_api_key�s!c	C@s�y[td|d|d|d|�}t|jd�}ig|D]}t|�^q@d6SWn%tk
r�}itd|�d6SXd	S(
u�
    Gets information about the defined API Keys.  Return list of apiKeys.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.describe_api_keys

    R0R1R2R3uitemsuapiKeysuboto3.get_erroruerrorN(R4R/tget_api_keysRRR(R0R1R2R3R7tapikeystapikeyR8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytdescribe_api_keys�s!(c	C@s�y�|d
krt�n|}td|d|d|d|�}|jd|d|d|d|�}	|	stitd	6Sitd	6t|	�d
6SWn,tk
r�}
itd	6td|
�d6SXd
S(u�
    Create an API key given name and description.

    An optional enabled argument can be provided.  If provided, the
    valid values are True|False.  This argument defaults to True.

    An optional stageKeys argument can be provided in the form of
    list of dictionary with 'restApiId' and 'stageName' as keys.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.create_api_key name description

        salt myminion boto_apigateway.create_api_key name description enabled=False

        salt myminion boto_apigateway.create_api_key name description \
             stageKeys='[{"restApiId": "id", "stageName": "stagename"}]'

    R0R1R2R3R R6tenabledt	stageKeysucreateduapiKeyuboto3.get_erroruerrorN(	RtlistR4tcreate_api_keyR@R?RRR(R R6RiRjR0R1R2R3R7RR8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pyRl�s!c	C@ssy@td|d|d|d|�}|jd|�itd6SWn,tk
rn}itd6td|�d6SXd	S(
u�
    Deletes a given apiKey

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.delete_api_key apikeystring

    R0R1R2R3Rbudeleteduboto3.get_erroruerrorN(R4tdelete_api_keyR?RR@R(RbR0R1R2R3R7R8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pyRm�s!cC@s4|jd|didd6|d6|d6g�}|S(u;
    the replace patch operation on an ApiKey resource
    RbtpatchOperationsureplaceuopupathuvalue(tupdate_api_key(R7RbRMtvalueR((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pyt_api_key_patch_replaces!cC@s2g|D]'\}}i|d6|d6|d6^qS(u:
    helper function to return patchOperations object
    uopupathuvalue((toptpvlisttpR((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pyt_api_key_patchopsscC@s%|jd|dtd|��}|S(ud
    the add patch operation for a list of (path, value) tuples on an ApiKey resource list path
    RbRnuadd(RoRu(R7RbRsR((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pyt_api_key_patch_addscC@s%|jd|dtd|��}|S(ug
    the remove patch operation for a list of (path, value) tuples on an ApiKey resource list path
    RbRnuremove(RoRu(R7RbRsR((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pyt_api_key_patch_remove$sc		C@s�yRtd|d|d|d|�}t||d|�}itd6t|�d6SWn,tk
r�}itd6td|�d	6SXd
S(u�
    update the given apiKey with the given description.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.update_api_key_description api_key description

    R0R1R2R3u/descriptionuupdateduapiKeyuboto3.get_erroruerrorN(R4RqR?RRR@R(	RbR6R0R1R2R3R7RR8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytupdate_api_key_description-s!c	C@swyKtd|d|d|d|�}t||dd�}it|�d6SWn%tk
rr}itd|�d	6SXd
S(u�
    enable the given apiKey.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.enable_api_key api_key

    R0R1R2R3u/enableduTrueuapiKeyuboto3.get_erroruerrorN(R4RqRRR(RbR0R1R2R3R7RR8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytenable_api_key@s!c	C@swyKtd|d|d|d|�}t||dd�}it|�d6SWn%tk
rr}itd|�d	6SXd
S(u�
    disable the given apiKey.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.enable_api_key api_key

    R0R1R2R3u/enableduFalseuapiKeyuboto3.get_erroruerrorN(R4RqRRR(RbR0R1R2R3R7RR8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytdisable_api_keySs!c	C@s�yntd|d|d|d|�}g|D]}d|f^q+}t|||�}	itd6t|	�d6SWn,tk
r�}
itd6td|
�d	6SXd
S(u�
    associate the given stagekeyslist to the given apiKey.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.associate_stagekeys_api_key \
                api_key '["restapi id/stage name", ...]'

    R0R1R2R3u/stagesu
associateduapiKeyuboto3.get_erroruerrorN(R4RvR?RRR@R(Rbt
stagekeyslistR0R1R2R3R7tstagekeyRsRR8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytassociate_api_key_stagekeysfs!c	C@s�yatd|d|d|d|�}g|D]}d|f^q+}t|||�}	itd6SWn,tk
r�}
itd6td|
�d6SXd	S(
u�
    disassociate the given stagekeyslist to the given apiKey.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.disassociate_stagekeys_api_key \
                api_key '["restapi id/stage name", ...]'

    R0R1R2R3u/stagesu
disassociateduboto3.get_erroruerrorN(R4RwR?RR@R(RbR{R0R1R2R3R7R|RsRR8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytdisassociate_api_key_stagekeys{s!c
	C@s�y�td|d|d|d|�}g}|jd|�}xMtr�|r?||d}d|kriPn|jd|d|d�}q?q?Wig|D]}t|�^q�d	6SWn%tk
r�}	itd
|	�d6SXdS(
u�
    Gets information about the defined API Deployments.  Return list of api deployments.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.describe_api_deployments restApiId

    R0R1R2R3RBuitemsupositionR&udeploymentsuboto3.get_erroruerrorN(R4tget_deploymentsR?RRR(
RBR0R1R2R3R7tdeploymentst_deploymentst
deploymentR8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytdescribe_api_deployments�s!	#(c		C@szyNtd|d|d|d|�}|jd|d|�}it|�d6SWn%tk
ru}itd|�d	6SXd
S(u�
    Get API deployment for a given restApiId and deploymentId.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.describe_api_deployent restApiId deploymentId

    R0R1R2R3RBtdeploymentIdu
deploymentuboto3.get_erroruerrorN(R4tget_deploymentRRR(	RBR�R0R1R2R3R7R�R8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytdescribe_api_deployment�s!c
	C@s�ystd|d|d|d|�}|jd|d|didd	6d
d6|d6g�}itd
6t|�d6SWn,tk
r�}	itd
6td|	�d6SXdS(u�
    Activates previously deployed deployment for a given stage

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.activate_api_deployent restApiId stagename deploymentId

    R0R1R2R3RBt	stageNameRnureplaceuopu
/deploymentIdupathuvalueuseturesponseuboto3.get_erroruerrorN(R4tupdate_stageR?RRR@R(
RBR�R�R0R1R2R3R7RR8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytactivate_api_deployment�s!
uu0.5cC@s�y�|dkrt�n|}td|d|d|	d|
�}|jd|d|d|d|d	|d
|d|�}itd6t|�d
6SWn,tk
r�}
itd6td|
�d6SXdS(u#
    Creates a new API deployment.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.create_api_deployent restApiId stagename stageDescription='' \
        description='' cacheClusterEnabled=True|False cacheClusterSize=0.5 variables='{"name": "value"}'

    R0R1R2R3RBR�tstageDescriptionR6tcacheClusterEnabledtcacheClusterSizet	variablesucreatedu
deploymentuboto3.get_erroruerrorN(	RRR4tcreate_deploymentR?RRR@R(RBR�R�R6R�R�R�R0R1R2R3R7R�R8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytcreate_api_deployment�s!	c	C@syyFtd|d|d|d|�}|jd|d|�itd6SWn,tk
rt}itd6td|�d	6SXd
S(u�
    Deletes API deployment for a given restApiId and deploymentID

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.delete_api_deployent restApiId deploymentId

    R0R1R2R3RBR�udeleteduboto3.get_erroruerrorN(R4tdelete_deploymentR?RR@R(RBR�R0R1R2R3R7R8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytdelete_api_deployment�s!cC@s�y�t||d|d|d|d|�}|jd�rTitd6|jd�d6Std|d|d|d|�}|jd�}	|	jdi�}
g}xH|
D]@}||kr�|jtd	d
ddj|�d
d��q�q�Wxgtj|�D]V\}
}|
|
ks|
|
|kr�|jtd	dddj|
�d
|��q�q�W|rx|j	d|d|d|�}	nit
d6t|	�d6SWn,tk
r�}itd6t
d|�d6SXdS(u

    Overwrite the stage variables for the given restApiId and stage name with the given variables,
    variables must be in the form of a dictionary.  Overwrite will always remove all the existing
    stage variables associated with the given restApiId and stage name, follow by the adding of all the
    variables specified in the variables dictionary

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.overwrite_api_stage_variables restApiId stageName variables='{"name": "value"}'

    R0R1R2R3uerroru	overwriteustageu	variablesRruremoveRMu/variables/{0}RpuureplaceRBR�Rnuboto3.get_errorN(tdescribe_api_stageR'R@R4RTRRRRR�R?RRR(RBR�R�R0R1R2R3tresR7tstagetold_varst	patch_opstold_vartvartvalR8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytoverwrite_api_stage_variabless0'!
c		C@szyNtd|d|d|d|�}|jd|d|�}it|�d6SWn%tk
ru}itd|�d	6SXd
S(u�
    Get API stage for a given apiID and stage name

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.describe_api_stage restApiId stageName

    R0R1R2R3RBR�ustageuboto3.get_erroruerrorN(R4t	get_stageRRR(	RBR�R0R1R2R3R7R�R8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pyR�2s!c
	C@s�yetd|d|d|d|�}|jd|d|�}ig|dD]}t|�^qJd6SWn%tk
r�}	itd	|	�d
6SXdS(u�
    Get all API stages for a given apiID and deploymentID

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.describe_api_stages restApiId deploymentId

    R0R1R2R3RBR�uitemustagesuboto3.get_erroruerrorN(R4t
get_stagesRRR(
RBR�R0R1R2R3R7tstagesR�R8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytdescribe_api_stagesEs!,cC@s�y�|dkrt�n|}td|d|d|	d|
�}|jd|d|d|d|d	|d
|d|�}itd6t|�d
6SWn,tk
r�}
itd6td|
�d6SXdS(u@
    Creates a new API stage for a given restApiId and deploymentId.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.create_api_stage restApiId stagename deploymentId \
            description='' cacheClusterEnabled=True|False cacheClusterSize='0.5' variables='{"name": "value"}'

    R0R1R2R3RBR�R�R6R�R�R�ucreatedustageuboto3.get_erroruerrorN(	RRR4tcreate_stageR?RRR@R(RBR�R�R6R�R�R�R0R1R2R3R7R�R8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytcreate_api_stageXs!c	C@syyFtd|d|d|d|�}|jd|d|�itd6SWn,tk
rt}itd6td|�d	6SXd
S(u�
    Deletes stage identified by stageName from API identified by restApiId

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.delete_api_stage restApiId stageName

    R0R1R2R3RBR�udeleteduboto3.get_erroruerrorN(R4tdelete_stageR?RR@R(RBR�R0R1R2R3R7R8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytdelete_api_stagers!c	C@syyFtd|d|d|d|�}|jd|d|�itd6SWn,tk
rt}itd6td|�d	6SXd
S(u�
    Flushes cache for the stage identified by stageName from API identified by restApiId

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.flush_api_stage_cache restApiId stageName

    R0R1R2R3RBR�uflusheduboto3.get_erroruerrorN(R4tflush_stage_cacheR?RR@R(RBR�R0R1R2R3R7R8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytflush_api_stage_cache�s!cC@s(y�t||d|d|d|	d|
�jd�}|r�|dkrNt�n|}|dkrit�n|}td|d|d|	d|
�}|jd|d|dd	|d
t|�d|d|d
|�}
itd6|
d6Sitd6dd6SWn,t	k
r#}itd6t
d|�d6SXdS(uN
    Creates API method for a resource in the given API

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.create_api_method restApiId resourcePath, httpMethod, authorizationType, \
            apiKeyRequired=False, requestParameters='{"name", "value"}', requestModels='{"content-type", "value"}'

    R0R1R2R3uresourceRBRZuidR]tauthorizationTypetapiKeyRequiredtrequestParameterst
requestModelsucreatedumethoduFailed to create methoduerroruboto3.get_errorN(ROR'RRR4t
put_methodtstrR?R@RR(RBR_R]R�R�R�R�R0R1R2R3RNR7R`R8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytcreate_api_method�s!cC@s�y�t||d|d|d|d|�jd�}|r�td|d|d|d|�}|jd|d|dd	|�}	it|	�d
6Sidd6SWn%tk
r�}
itd
|
�d6SXdS(u�
    Get API method for a resource in the given API

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.describe_api_method restApiId resourcePath httpMethod

    R0R1R2R3uresourceRBRZuidR]umethodu'get API method failed: no such resourceuerroruboto3.get_errorN(ROR'R4R^RRR(RBR_R]R0R1R2R3RNR7R`R8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytdescribe_api_method�s!"c
C@s�y�t||d|d|d|d|�jd�}|r�td|d|d|d|�}|jd|d|dd	|�itd
6Sitd
6dd6SWn,tk
r�}	itd
6td
|	�d6SXdS(u�
    Delete API method for a resource in the given API

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.delete_api_method restApiId resourcePath httpMethod

    R0R1R2R3uresourceRBRZuidR]udeletedu'get API method failed: no such resourceuerroruboto3.get_errorN(ROR'R4t
delete_methodR?R@RR(
RBR_R]R0R1R2R3RNR7R8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytdelete_api_method�s! c

C@s"y�t||d|d|d|d|	�jd�}
|
r�|dkrNt�n|}|dkrit�n|}td|d|d|d|	�}|jd|d|
dd	|d
t|�d|d|�}itd
6|d6Sitd
6dd6SWn,t	k
r}
itd
6t
d|
�d6SXdS(uZ
    Create API method response for a method on a given resource in the given API

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.create_api_method_response restApiId resourcePath httpMethod \
               statusCode responseParameters='{"name", "True|False"}' responseModels='{"content-type", "model"}'

    R0R1R2R3uresourceRBRZuidR]t
statusCodetresponseParameterstresponseModelsucreateduresponseuno such resourceuerroruboto3.get_errorN(ROR'RRR4tput_method_responseR�R?R@RR(RBR_R]R�R�R�R0R1R2R3RNR7RR8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytcreate_api_method_response�s
!cC@s�y�t||d|d|d|d|�jd�}|r�td|d|d|d|�}	|	jd|d|dd	|d
t|��itd6Sitd6dd
6SWn,tk
r�}
itd6td|
�d
6SXdS(u�
    Delete API method response for a resource in the given API

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.delete_api_method_response restApiId resourcePath httpMethod statusCode

    R0R1R2R3uresourceRBRZuidR]R�udeleteduno such resourceuerroruboto3.get_errorN(	ROR'R4tdelete_method_responseR�R?R@RR(RBR_R]R�R0R1R2R3RNR7R8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytdelete_api_method_responses!cC@s�y�t||d|d|d|d|�jd�}|r�td|d|d|d|�}	|	jd|d|dd	|d
t|��}
it|
�d6Sidd
6SWn%tk
r�}itd|�d
6SXdS(u�
    Get API method response for a resource in the given API

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.describe_api_method_response restApiId resourcePath httpMethod statusCode

    R0R1R2R3uresourceRBRZuidR]R�uresponseuno such resourceuerroruboto3.get_errorN(ROR'R4tget_method_responseR�RRR(RBR_R]R�R0R1R2R3RNR7RR8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytdescribe_api_method_responses!c		C@s�yatd|d|d|d|�}t|jdd|�}ig|D]}t|�^qFd6SWn%tk
r�}itd|�d	6SXd
S(u�
    Get all models for a given API

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.describe_api_models restApiId

    R0R1R2R3uitemsRBumodelsuboto3.get_erroruerrorN(R4R/t
get_modelsRRR(	RBR0R1R2R3R7tmodelstmodelR8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytdescribe_api_models6s!(c
	C@s�yTtd|d|d|d|�}|jd|d|d|�}it|�d6SWn%tk
r{}	itd	|	�d
6SXdS(u�
    Get a model by name for a given API

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.describe_api_model restApiId modelName [True]

    R0R1R2R3RBt	modelNametflattenumodeluboto3.get_erroruerrorN(R4t	get_modelRRR(
RBR�R�R0R1R2R3R7R�R8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytdescribe_api_modelIs!cC@sAt||d|d|d|d|�}it|jd��d6S(u�
    Check to see if the given modelName exists in the given restApiId

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.api_model_exists restApiId modelName
    R0R1R2R3umodeluexists(R�R;R'(RBR�R0R1R2R3RF((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytapi_model_exists\s
'c	C@s:|jd|d|didd6|d6|d6g�}|S(u9
    the replace patch operation on a Model resource
    RBR�Rnureplaceuopupathuvalue(tupdate_model(R7RBR�RMRpR((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pyt_api_model_patch_replaceks!c	C@s�yt|t�r'tjjj|�n|}td|d|d|d|�}t|||d|�}	itd6t	|	�d6SWn,t
k
r�}
itd6td|
�d	6SXd
S(u�
    update the schema (in python dictionary format) for the given model in the given restApiId

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.update_api_model_schema restApiId modelName schema

    R0R1R2R3u/schemauupdatedumodeluboto3.get_erroruerrorN(
RRR	R
tjsontdumpsR4R�R?RRR@R(RBR�tschemaR0R1R2R3tschema_jsonR7RR8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytupdate_api_model_schemats*!c	C@syyFtd|d|d|d|�}|jd|d|�itd6SWn,tk
rt}itd6td|�d	6SXd
S(u�
    Delete a model identified by name in a given API

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.delete_api_model restApiId modelName

    R0R1R2R3RBR�udeleteduboto3.get_erroruerrorN(R4tdelete_modelR?RR@R(RBR�R0R1R2R3R7R8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytdelete_api_model�s!uapplication/jsonc	
C@s�y�t|t�r'tjjj|�n|}	td|d|d|d|�}
|
jd|d|d|d|	d	|�}itd
6t	|�d6SWn,t
k
r�}itd
6td|�d
6SXdS(u#
    Create a new model in a given API with a given schema, currently only contentType supported is
    'application/json'

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.create_api_model restApiId modelName modelDescription '<schema>' 'content-type'

    R0R1R2R3RBR R6R�tcontentTypeucreatedumodeluboto3.get_erroruerrorN(
RRR	R
R�R�R4tcreate_modelR?RRR@R(
RBR�tmodelDescriptionR�R�R0R1R2R3R�R7R�R8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytcreate_api_model�s
*!cC@s�y�t||d|d|d|d|�jd�}|r�td|d|d|d|�}|jd|d|dd	|�}	it|	�d
6Sidd6SWn%tk
r�}
itd
|
�d6SXdS(u�
    Get an integration for a given method in a given API

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.describe_api_integration restApiId resourcePath httpMethod

    R0R1R2R3uresourceRBRZuidR]uintegrationuno such resourceuerroruboto3.get_errorN(ROR'R4tget_integrationRRR(RBR_R]R0R1R2R3RNR7tintegrationR8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytdescribe_api_integration�s!"cC@s�y�t||d|d|d|d|�jd�}|r�td|d|d|d|�}	|	jd|d|dd	|d
|�}
it|
�d6Sidd
6SWn%tk
r�}itd|�d
6SXdS(u�
    Get an integration response for a given method in a given API

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.describe_api_integration_response restApiId resourcePath httpMethod statusCode

    R0R1R2R3uresourceRBRZuidR]R�uresponseuno such resourceuerroruboto3.get_errorN(ROR'R4tget_integration_responseRRR(RBR_R]R�R0R1R2R3RNR7RR8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pyt!describe_api_integration_response�s!c
C@s�y�t||d|d|d|d|�jd�}|r�td|d|d|d|�}|jd|d|dd	|�itd
6Sitd
6dd6SWn,tk
r�}	itd
6td
|	�d6SXdS(u�
    Deletes an integration for a given method in a given API

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.delete_api_integration restApiId resourcePath httpMethod

    R0R1R2R3uresourceRBRZuidR]udeleteduno such resourceuerroruboto3.get_errorN(ROR'R4tdelete_integrationR?R@RR(
RBR_R]R0R1R2R3RNR7R8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytdelete_api_integration�s! cC@s�y�t||d|d|d|d|�jd�}|r�td|d|d|d|�}	|	jd|d|dd	|d
|�itd6Sitd6dd
6SWn,tk
r�}
itd6td|
�d
6SXdS(u�
    Deletes an integration response for a given method in a given API

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.delete_api_integration_response restApiId resourcePath httpMethod statusCode

    R0R1R2R3uresourceRBRZuidR]R�udeleteduno such resourceuerroruboto3.get_errorN(ROR'R4tdelete_integration_responseR?R@RR(RBR_R]R�R0R1R2R3RNR7R8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytdelete_api_integration_response�s!
c	C@sH|jd�r|Stdd|d|d|d|�}dj||�S(uJ
    Helper function to get an ARN if name does not look like an ARN.
    uarn:aws:iam:uboto_iam.get_account_idR0R1R2R3uarn:aws:iam::{0}:role/{1}(t
startswitht__salt__R(R R0R1R2R3t
account_id((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pyt
_get_role_arns

c
C@ssy@t|d|	d|
d|d|�}t||d|	d|
d|d|�jd�}
|
r-|dkrrt�n|}|dkr�t�n|}td|	d|
d|d|�}|j�dkr�d}d}n|jd|d	|
d
d|d|d
|d|d|d|d|�	}itd6|d6Sit	d6dd6SWn,t
k
rn}it	d6td|�d6SXdS(uy
    Creates an integration for a given method in a given API.
    If integrationType is MOCK, uri and credential parameters will be ignored.

    uri is in the form of (substitute APIGATEWAY_REGION and LAMBDA_FUNC_ARN)
    "arn:aws:apigateway:APIGATEWAY_REGION:lambda:path/2015-03-31/functions/LAMBDA_FUNC_ARN/invocations"

    credentials is in the form of an iam role name or role arn.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.create_api_integration restApiId resourcePath httpMethod \
                             integrationType integrationHttpMethod uri credentials ['{}' ['{}']]

    R0R1R2R3uresourceuoptionsuRBRZuidR]ttypetintegrationHttpMethodturitcredentialsR�trequestTemplatesucreateduintegrationuno such resourceuerroruboto3.get_errorN(R�ROR'RRR4tlowertput_integrationR?R@RR(RBR_R]tintegrationTypeR�R�R�R�R�R0R1R2R3RNR7R�R8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytcreate_api_integration s&$!		cC@s"y�t||d|d|d|	d|
�jd�}|r�|dkrNt�n|}|dkrit�n|}td|d|d|	d|
�}|jd|d|dd	|d
|d|d|d
|�}
itd6|
d6Sitd6dd6SWn,tk
r}itd6t	d|�d6SXdS(u)
    Creates an integration response for a given method in a given API

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.create_api_integration_response restApiId resourcePath httpMethod \
                            statusCode selectionPattern ['{}' ['{}']]

    R0R1R2R3uresourceRBRZuidR]R�tselectionPatternR�tresponseTemplatesucreateduresponseuno such resourceuerroruboto3.get_errorN(
ROR'RRR4tput_integration_responseR?R@RR(RBR_R]R�R�R�R�R0R1R2R3RNR7RR8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytcreate_api_integration_responseKs !	cC@s'g|D]}|||kr|^qS(uW
    Helper to return list of usage plan items matching the given attribute value.
    ((tattrR tplanstplan((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pyt
_filter_planslsc
	C@s�y�td|d|d|d|�}t|jd�}|rQtd||�}n|rltd||�}nig|D]}t|�^qvd6SWn%tk
r�}	itd	|	�d
6SXdS(u�
    Returns a list of existing usage plans, optionally filtered to match a given plan name

    .. versionadded:: 2017.7.0

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.describe_usage_plans
        salt myminion boto_apigateway.describe_usage_plans name='usage plan name'
        salt myminion boto_apigateway.describe_usage_plans plan_id='usage plan id'

    R0R1R2R3uitemsunameuiduplansuboto3.get_erroruerrorN(R4R/tget_usage_plansR�RRR(
R tplan_idR0R1R2R3R7R�R�R8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytdescribe_usage_plansss!(cC@s:|dk	r6t|t�s6tdj|���q6ndS(u?
    Helper to verify that throttling parameters are valid
    u2throttle must be a dictionary, provided value: {0}N(RRRt	TypeErrorR(tthrottle((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pyt_validate_throttle�scC@s�|d
k	r�t|t�s3tdj|���ndddg}d|ks^|d|krtdjdj|����nd|kr�td	��q�nd
S(u:
    Helper to verify that quota parameters are valid
    u/quota must be a dictionary, provided value: {0}uDAYuWEEKuMONTHuperiodu>quota must have a valid period specified, valid values are {0}u,ulimitu#quota limit must have a valid valueN(RRRR�Rt
ValueErrortjoin(tquotatperiods((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pyt_validate_quota�s!c	C@s�y�t|�t|�td|�}|r9||d<n|rL||d<n|r_||d<ntd|d|d|d|�}	|	j|�}
itd	6|
d
6SWnNtk
r�}itd|�d6Stt	fk
r�}it
j|�d6SXd
S(u�
    Creates a new usage plan with throttling and quotas optionally applied

    .. versionadded:: 2017.7.0

    name
        Name of the usage plan

    throttle
        A dictionary consisting of the following keys:

        rateLimit
            requests per second at steady rate, float

        burstLimit
            maximum number of requests per second, integer

    quota
        A dictionary consisting of the following keys:

        limit
            number of allowed requests per specified quota period [required if quota parameter is present]

        offset
            number of requests to be subtracted from limit at the beginning of the period [optional]

        period
            quota period, must be one of DAY, WEEK, or MONTH. [required if quota parameter is present

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.create_usage_plan name='usage plan name' throttle='{"rateLimit": 10.0, "burstLimit": 10}'

    R udescriptionuthrottleuquotaR0R1R2R3ucreateduresultuboto3.get_erroruerrorN(R�R�RR4tcreate_usage_planR?RRR�R�Rt	text_type(R R6R�R�R0R1R2R3tvaluesR7R�R8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pyR��s"%




!c	C@s,y�t|�t|�td|d|d|d|�}g}|dkrh|jidd6dd6�nvd	|kr�|jid
d6dd6t|d	�d6�nd
|kr�|jid
d6dd6t|d
�d6�n|dkr|jidd6dd6�n�|jid
d6dd6t|d�d6�|jid
d6dd6t|d�d6�d|kr�|jid
d6dd6t|d�d6�n|r�|jd|d|�}	itd6|	d6Sitd6SWnNt	k
r�}
it
d|
�d6Sttfk
r'}
it
j|
�d6SXdS(u�
    Updates an existing usage plan with throttling and quotas

    .. versionadded:: 2017.7.0

    plan_id
        Id of the created usage plan

    throttle
        A dictionary consisting of the following keys:

        rateLimit
            requests per second at steady rate, float

        burstLimit
            maximum number of requests per second, integer

    quota
        A dictionary consisting of the following keys:

        limit
            number of allowed requests per specified quota period [required if quota parameter is present]

        offset
            number of requests to be subtracted from limit at the beginning of the period [optional]

        period
            quota period, must be one of DAY, WEEK, or MONTH. [required if quota parameter is present

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.update_usage_plan plan_id='usage plan id' throttle='{"rateLimit": 10.0, "burstLimit": 10}'

    R0R1R2R3uremoveuopu	/throttleupathu	rateLimitureplaceu/throttle/rateLimituvalueu
burstLimitu/throttle/burstLimitu/quotau
/quota/perioduperiodu/quota/limitulimituoffsetu
/quota/offsettusagePlanIdRnuupdateduresultuboto3.get_erroruerrorN(R�R�R4RRTR�tupdate_usage_planR?R@RRR�R�RR�(R�R�R�R0R1R2R3R7RnR�R8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pyR��s4%

!//,,/	c	C@s�y�td|d|d|d|d|�}d|krEi|dd6Sd|kr�|dr�td|d|d|d|�}|jd|�}nitd	6|d
6SWn%tk
r�}itd|�d6SXdS(
u�
    Deletes usage plan identified by plan_id

    .. versionadded:: 2017.7.0

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.delete_usage_plan plan_id='usage plan id'

    R�R0R1R2R3uerroruplansR�udeleteduusagePlanIduboto3.get_errorN(R�R4tdelete_usage_planR?RR(	R�R0R1R2R3texistingR7R�R8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pyR�+s
'!c	C@s�y�g}xD|D]<}|ji|d6dd6dj|d|d�d6�qWd}	|r�td|d	|d
|d|�}
|
jd|d
|�}	nitd6|	d6SWn?tk
r�}itd|�d6Stk
r�}i|d6SXdS(u�
    Helper function that updates the usage plan identified by plan_id by adding or removing it to each of the stages, specified by apis parameter.

    apis
        a list of dictionaries, where each dictionary contains the following:

        apiId
            a string, which is the id of the created API in AWS ApiGateway

        stage
            a string, which is the stage that the created API is deployed to.

    op
        'add' or 'remove'
    uopu
/apiStagesupathu{0}:{1}uapiIdustageuvalueR0R1R2R3R�Rnusuccessuresultuboto3.get_erroruerrorN(	RTRRR4R�R?RRt	Exception(R�R!RrR0R1R2R3RnR"R�R7R8((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pyt_update_usage_plan_apisFs"
	#!cC@s(t||dd|d|d|d|�S(uR
    Attaches given usage plan to each of the apis provided in a list of apiId and stage values

    .. versionadded:: 2017.7.0

    apis
        a list of dictionaries, where each dictionary contains the following:

        apiId
            a string, which is the id of the created API in AWS ApiGateway

        stage
            a string, which is the stage that the created API is deployed to.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.attach_usage_plan_to_apis plan_id='usage plan id' apis='[{"apiId": "some id 1", "stage": "some stage 1"}]'

    uaddR0R1R2R3(R�(R�R!R0R1R2R3((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytattach_usage_plan_to_apisjscC@s(t||dd|d|d|d|�S(uS
    Detaches given usage plan from each of the apis provided in a list of apiId and stage value

    .. versionadded:: 2017.7.0

    apis
        a list of dictionaries, where each dictionary contains the following:

        apiId
            a string, which is the id of the created API in AWS ApiGateway

        stage
            a string, which is the stage that the created API is deployed to.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_apigateway.detach_usage_plan_to_apis plan_id='usage plan id' apis='[{"apiId": "some id 1", "stage": "some stage 1"}]'

    uremoveR0R1R2R3(R�(R�R!R0R1R2R3((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pytdetach_usage_plan_from_apis�s(dt__doc__t
__future__RRRtloggingRtsalt.extRtsalt.utils.compatR	tsalt.utils.jsontsalt.utils.versionst	getLoggerRtlogtbototboto3tbotocore.exceptionsRtbotocoreRtfound_botocore_versiontsetLeveltCRITICALR?RtImportErrorR@R
RRR#R%R/RR9R:R<RARGRLRORYR\RaRdRhRlRmRqRuRvRwRxRyRzR}R~R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�RR(((s@/usr/lib/python2.7/site-packages/salt/modules/boto_apigateway.pyt<module>Ms�


							&%								.				*				:J$

Zerion Mini Shell 1.0