%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/modules/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/modules/cassandra.pyo

�
���^c@@sdZddlmZmZmZddlZeje�Zddl	Z
ddlmZe
ZyddlmZeZWnek
r�nXd�Zd�Zd�Zd	�Zd
�Zd�Zd�Zd
�Zd�Zd�Zdd�Zd�ZdS(uE
Cassandra NoSQL Database Module

:depends:   - pycassa Cassandra Python adapter
:configuration:
    The location of the 'nodetool' command, host, and thrift port needs to be
    specified via pillar::

        cassandra.nodetool: /usr/local/bin/nodetool
        cassandra.host: localhost
        cassandra.thrift_port: 9160
i(tabsolute_importtunicode_literalstprint_functionN(tsix(t
SystemManagercC@s9tstdfStr/tjjjd�r/dStdfS(uH
    Only load if pycassa is available and the system is configured
    uGThe cassandra execution module cannot be loaded: pycassa not installed.unodetoolu	cassandrauDThe cassandra execution module cannot be loaded: nodetool not found.(tHAS_PYCASSAtFalsetsalttutilstpathtwhich(((s:/usr/lib/python2.7/site-packages/salt/modules/cassandra.pyt__virtual__ s

cC@s=tdd�}tdd�}tddj|||��S(u|
    Internal cassandra nodetool wrapper. Some functions are not
    available via pycassa so we must rely on nodetool.
    u
config.optionucassandra.nodetoolucassandra.hostucmd.run_stdoutu{0} -h {1} {2}(t__salt__tformat(tcmdtnodetoolthost((s:/usr/lib/python2.7/site-packages/salt/modules/cassandra.pyt	_nodetool,scC@s?tjtdd��}tdd�}tdj||��S(u;
    Return a pycassa system manager connection object
    u
config.optionucassandra.THRIFT_PORTucassandra.hostu{0}:{1}(Rt	text_typeRRR
(tthrift_portR((s:/usr/lib/python2.7/site-packages/salt/modules/cassandra.pyt_sys_mgr6scC@s
td�S(u}
    Return compactionstats info

    CLI Example:

    .. code-block:: bash

        salt '*' cassandra.compactionstats
    ucompactionstats(R(((s:/usr/lib/python2.7/site-packages/salt/modules/cassandra.pytcompactionstats?s
cC@s
td�S(uv
    Return the cassandra version

    CLI Example:

    .. code-block:: bash

        salt '*' cassandra.version
    uversion(R(((s:/usr/lib/python2.7/site-packages/salt/modules/cassandra.pytversionLs
cC@s
td�S(uo
    Return netstats info

    CLI Example:

    .. code-block:: bash

        salt '*' cassandra.netstats
    unetstats(R(((s:/usr/lib/python2.7/site-packages/salt/modules/cassandra.pytnetstatsYs
cC@s
td�S(um
    Return tpstats info

    CLI Example:

    .. code-block:: bash

        salt '*' cassandra.tpstats
    utpstats(R(((s:/usr/lib/python2.7/site-packages/salt/modules/cassandra.pyttpstatsfs
cC@s
td�S(uq
    Return cassandra node info

    CLI Example:

    .. code-block:: bash

        salt '*' cassandra.info
    uinfo(R(((s:/usr/lib/python2.7/site-packages/salt/modules/cassandra.pytinfoss
cC@s
td�S(uq
    Return cassandra ring info

    CLI Example:

    .. code-block:: bash

        salt '*' cassandra.ring
    uring(R(((s:/usr/lib/python2.7/site-packages/salt/modules/cassandra.pytring�s
cC@st�}|j�S(uu
    Return existing keyspaces

    CLI Example:

    .. code-block:: bash

        salt '*' cassandra.keyspaces
    (Rtlist_keyspaces(tsys((s:/usr/lib/python2.7/site-packages/salt/modules/cassandra.pyt	keyspaces�s
	cC@s�t�}|j�}|rG||kr@t|j|�j��SdSn:i}x-|D]%}t|j|�j��||<qTW|SdS(u�
    Return existing column families for all keyspaces
    or just the provided one.

    CLI Example:

    .. code-block:: bash

        salt '*' cassandra.column_families
        salt '*' cassandra.column_families <keyspace>
    N(RRtlisttget_keyspace_column_familiestkeystNone(tkeyspaceRtkspstrettkspace((s:/usr/lib/python2.7/site-packages/salt/modules/cassandra.pytcolumn_families�s	
#cC@sJt�}yt|j|�|�SWntk
rEtjd�dSXdS(u�
    Return a dictionary of column family definitions for the given
    keyspace/column_family

    CLI Example:

    .. code-block:: bash

        salt '*' cassandra.column_family_definition <keyspace> <column_family>

    uInvalid Keyspace/CF combinationN(RtvarsRt	ExceptiontlogtdebugR!(R"t
column_familyR((s:/usr/lib/python2.7/site-packages/salt/modules/cassandra.pytcolumn_family_definition�s	

( t__doc__t
__future__RRRtloggingt	getLoggert__name__R)tsalt.utils.pathRtsalt.extRRRtpycassa.system_managerRtTruetImportErrorRRRRRRRRRRR!R&R,(((s:/usr/lib/python2.7/site-packages/salt/modules/cassandra.pyt<module>
s.

		
			
	
	
	
	
	
	

Zerion Mini Shell 1.0