%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/states/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/states/boto_elasticsearch_domain.pyo

�
���^c@@s�dZddlmZmZmZddlZddlZddlZddl	m
Z
eje�Z
d�Zd�Zdddddddddddd�Zddddd	�ZdS(
u:

Manage Elasticsearch Domains
============================

.. versionadded:: 2016.11.0

Create and destroy Elasticsearch domains. Be aware that this interacts with Amazon's services,
and so may incur charges.

This module uses ``boto3``, which can be installed via package, or pip.

This module accepts explicit vpc credentials but can also utilize
IAM roles assigned to the instance through Instance Profiles. Dynamic
credentials are then automatically obtained from AWS API and no further
configuration is necessary. More information available `here
<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 file or
in the minion's config file:

.. code-block:: yaml

    vpc.keyid: GKTADJGHEIQSXMKKRBJ08H
    vpc.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs

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

.. code-block:: yaml

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

.. code-block:: yaml

    Ensure domain exists:
        boto_elasticsearch_domain.present:
            - DomainName: mydomain
            - profile='user-credentials'
            - ElasticsearchVersion: "2.3"
            - ElasticsearchClusterConfig:
                InstanceType": "t2.micro.elasticsearch"
                InstanceCount: 1
                DedicatedMasterEnabled: False
                ZoneAwarenessEnabled: False
            - EBSOptions:
                EBSEnabled: True
                VolumeType: "gp2"
                VolumeSize: 10
                Iops: 0
            - AccessPolicies:
                Version: "2012-10-17"
                Statement:
                  - Effect: "Allow"
                  - Principal:
                      AWS: "*"
                  - Action:
                    - "es:*"
                  - Resource: "arn:aws:es:*:111111111111:domain/mydomain/*"
                  - Condition:
                      IpAddress:
                        "aws:SourceIp":
                          - "127.0.0.1"
                          - "127.0.0.2"
            - SnapshotOptions:
                AutomatedSnapshotStartHour: 0
            - AdvancedOptions:
                rest.action.multi.allow_explicit_index": "true"
            - Tags:
                a: "b"
            - region: us-east-1
            - keyid: GKTADJGHEIQSXMKKRBJ08H
            - key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs

i(tabsolute_importtprint_functiontunicode_literalsN(tsixcC@sdtkrdStS(u)
    Only load if boto is available.
    u boto_elasticsearch_domain.existsuboto_elasticsearch_domain(t__salt__tFalse(((sI/usr/lib/python2.7/site-packages/salt/states/boto_elasticsearch_domain.pyt__virtual___scC@std||�S(Nuboto3.json_objs_equal(t	__utils__(tcurrenttdesired((sI/usr/lib/python2.7/site-packages/salt/states/boto_elasticsearch_domain.pyt
_compare_jsonfsu1.5c
C@si|d6td6dd6id6}
|d:krSitd6dd6d	d
6td6}n|d:kroitd6}n|d:kr�id
d6}n|d:kr�idd6}n|d:kr�i}n|d:k	r-t|tj�r-ytjjj	|�}Wq-t
k
r)}t|
d<dj|j�|
d<|
SXnt
dd|d|d|	d|
d|�}d|kr�t|
d<dj|dd�|
d<|
S|jd�s�tdr�dj|�|
d<d:|
d<|
St
dd|d|d|d |d!|d"|d#t|�d|d|	d|
d|�}|jd$�sTt|
d<dj|dd�|
d<|
St
d%|d|d|	d|
d|�}id:d&6|
dd'<||
dd(<d)j|�|
d<|
Stjj|
dd*j|�g�|
d<i|
d<t
d+d|d|d|	d|
d|�d&}|jd,�t|�krft|
d<d-j|jd,�t|��|
d<|
St
d%d|d|d|	d|
d|�d&}tjjj	|d.�|d.<|jd/i�jd�s|jd/i�}|jd0d:�|jd1d:�ni}t}i|d26|d/6|d.6|d36|d46}x{tj|�D]j\}}t|||�sGt}|||<||
djd(i�|<|||
djd'i�|<qGqGW|r{tdr�d5j|�}||
d<d:|
d<|
Stjj|
dd6g�|
d<t
d7d|d|d|	d|
d||�}|jd8�s{t|
d<d9j|d�|
d<i|
d<|
Sn|
S(;u�	
    Ensure domain exists.

    name
        The name of the state definition

    DomainName
        Name of the domain.

    ElasticsearchClusterConfig
        Configuration options for an Elasticsearch domain. Specifies the
        instance type and number of instances in the domain cluster.

        InstanceType (string) --
        The instance type for an Elasticsearch cluster.

        InstanceCount (integer) --
        The number of instances in the specified domain cluster.

        DedicatedMasterEnabled (boolean) --
        A boolean value to indicate whether a dedicated master node is enabled.
        See About Dedicated Master Nodes for more information.

        ZoneAwarenessEnabled (boolean) --
        A boolean value to indicate whether zone awareness is enabled. See About
        Zone Awareness for more information.

        DedicatedMasterType (string) --
        The instance type for a dedicated master node.

        DedicatedMasterCount (integer) --
        Total number of dedicated master nodes, active and on standby, for the
        cluster.

    EBSOptions
        Options to enable, disable and specify the type and size of EBS storage
        volumes.

        EBSEnabled (boolean) --
        Specifies whether EBS-based storage is enabled.

        VolumeType (string) --
        Specifies the volume type for EBS-based storage.

        VolumeSize (integer) --
        Integer to specify the size of an EBS volume.

        Iops (integer) --
        Specifies the IOPD for a Provisioned IOPS EBS volume (SSD).

    AccessPolicies
        IAM access policy

    SnapshotOptions
        Option to set time, in UTC format, of the daily automated snapshot.
        Default value is 0 hours.

        AutomatedSnapshotStartHour (integer) --
        Specifies the time, in UTC format, when the service takes a daily
        automated snapshot of the specified Elasticsearch domain. Default value
        is 0 hours.

    AdvancedOptions
        Option to allow references to indices in an HTTP request body. Must be
        false when configuring access to individual sub-resources. By default,
        the value is true .

    region
        Region to connect to.

    key
        Secret key to be used.

    keyid
        Access key to be used.

    profile
        A dict with region, key and keyid, or a pillar key (string) that
        contains a dict with region, key and keyid.

    ElasticsearchVersion
        String of format X.Y to specify version for the Elasticsearch domain eg.
        "1.5" or "2.3".
    unameuresultuucommentuchangesuDedicatedMasterEnablediu
InstanceCountum3.medium.elasticsearchuInstanceTypeuZoneAwarenessEnabledu
EBSEnablediuAutomatedSnapshotStartHourutrueu&rest.action.multi.allow_explicit_indexuFailed to create domain: {0}.u boto_elasticsearch_domain.existst
DomainNametregiontkeytkeyidtprofileuerrorumessageuexistsutestu Domain {0} is set to be created.u boto_elasticsearch_domain.createtElasticsearchClusterConfigt
EBSOptionstAccessPoliciestSnapshotOptionstAdvancedOptionstElasticsearchVersionucreatedu"boto_elasticsearch_domain.describeudomainuoldunewuDomain {0} created.uDomain {0} is present.u boto_elasticsearch_domain.statusuElasticsearchVersionuDFailed to update domain: version cannot be modified from {0} to {1}.uAccessPoliciesu
EBSOptionsu
VolumeSizeu
VolumeTypeuElasticsearchClusterConfiguSnapshotOptionsuAdvancedOptionsuDomain {0} set to be modified.uDomain to be modifiedu boto_elasticsearch_domain.updateuupdateduFailed to update domain: {0}.N(tTruetNoneRt
isinstanceRtstring_typestsalttutilstjsontloadst
ValueErrortformattmessageRtgett__opts__tstrtostlineseptjointpopt	iteritemsR
t
setdefault(tnameRRRRRRtTagsRR
RRRtrettetrt	_describet_statustoptst	comm_argstneed_updatetes_optstktvtmsg((sI/usr/lib/python2.7/site-packages/salt/states/boto_elasticsearch_domain.pytpresentjs�]





	





)






%


 		

cC@sni|d6td6dd6id6}td|d|d|d	|d
|�}d|krt|d<dj|dd
�|d<|S|r�|dr�dj|�|d<|Stdr�dj|�|d<d|d<|Std|d|d|d	|d
|�}|ds-t|d<dj|dd
�|d<|Si|d6|dd<idd6|dd<dj|�|d<|S(u�
    Ensure domain with passed properties is absent.

    name
        The name of the state definition.

    DomainName
        Name of the domain.

    region
        Region to connect to.

    key
        Secret key to be used.

    keyid
        Access key to be used.

    profile
        A dict with region, key and keyid, or a pillar key (string) that
        contains a dict with region, key and keyid.
    unameuresultuucommentuchangesu boto_elasticsearch_domain.existsRR
RRuerroruFailed to delete domain: {0}.umessageuexistsuDomain {0} does not exist.utestu Domain {0} is set to be removed.u boto_elasticsearch_domain.deleteudeletedudomainuoldunewuDomain {0} deleted.N(RRRRR"R(R*RRR
RRR,R.((sI/usr/lib/python2.7/site-packages/salt/states/boto_elasticsearch_domain.pytabsentHs8








(t__doc__t
__future__RRRtloggingR$tsalt.utils.jsonRtsalt.extRt	getLoggert__name__tlogRR
RR8R9(((sI/usr/lib/python2.7/site-packages/salt/states/boto_elasticsearch_domain.pyt<module>Os"		�

Zerion Mini Shell 1.0