%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/proxy/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/proxy/rest_sample.pyc

�
���^c@@s.dZddlmZmZmZddlZddlZeZ	dgZ
iZiZej
e�Zd�Zd�Zd�Zd�Zd	�Zd
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d�Z"d�Z#d�Z$d�Z%dS(u�
This is a simple proxy-minion designed to connect to and communicate with
the bottle-based web service contained in https://github.com/saltstack/salt-contrib/tree/master/proxyminion_rest_example
i(tabsolute_importtprint_functiontunicode_literalsNurest_samplecC@stjd�tS(u6
    Only return if all the modules are available
    u)rest_sample proxy __virtual__() called...(tlogtdebugtTrue(((s:/usr/lib/python2.7/site-packages/salt/proxy/rest_sample.pyt__virtual__s
cC@sStjd�ttd<|ddtd<tdjd�sOtdcd7<ndS(Nu"rest_sample proxy init() called...uinitializeduproxyuurlu/(RRRtDETAILStendswith(topts((s:/usr/lib/python2.7/site-packages/salt/proxy/rest_sample.pytinit)s


cC@stjdt�S(u�
    Since grains are loaded in many different places and some of those
    places occur before the proxy can be initialized, return whether
    our init() function has been called
    uinitialized(RtgettFalse(((s:/usr/lib/python2.7/site-packages/salt/proxy/rest_sample.pytinitialized5scC@s.tjd�tjd�tjd�t�S(Nu8=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-uproxys alive() fn called(RRtping(R	((s:/usr/lib/python2.7/site-packages/salt/proxy/rest_sample.pytalive>s


cC@sEtjjj|ddddddt�}|ddjdd	�S(
u�
    Return a unique ID for this proxy minion.  This ID MUST NOT CHANGE.
    If it changes while the proxy is running the salt-master will get
    really confused and may stop talking to this minion
    uproxyuurluidtdecode_typeujsontdecodeudictuasciiuignore(tsalttutilsthttptqueryRtencode(R	tr((s:/usr/lib/python2.7/site-packages/salt/proxy/rest_sample.pytidEs-cC@sTtjdi�sLtjjjtdddddt�}|dtd<ntdS(u0
    Get the grains from the proxied device
    ugrains_cacheuurluinfoRujsonRudict(RRRRRRR(R((s:/usr/lib/python2.7/site-packages/salt/proxy/rest_sample.pytgrainsOs)cC@sdtd<t�S(u4
    Refresh the grains from the proxied device
    ugrains_cacheN(tNoneRR(((s:/usr/lib/python2.7/site-packages/salt/proxy/rest_sample.pytgrains_refreshYs
cC@sidd6S(NubThis key is here because a function in grains/rest_sample.py called fns() here in the proxymodule.udetails((((s:/usr/lib/python2.7/site-packages/salt/proxy/rest_sample.pytfnsascC@s5tjjjtdd|dddt�}|dS(u.
    Start a "service" on the REST server
    uurluservice/start/RujsonRudict(RRRRRR(tnameR((s:/usr/lib/python2.7/site-packages/salt/proxy/rest_sample.pyt
service_startfs-cC@s5tjjjtdd|dddt�}|dS(u-
    Stop a "service" on the REST server
    uurlu
service/stop/RujsonRudict(RRRRRR(RR((s:/usr/lib/python2.7/site-packages/salt/proxy/rest_sample.pytservice_stopns-cC@s5tjjjtdd|dddt�}|dS(u0
    Restart a "service" on the REST server
    uurluservice/restart/RujsonRudict(RRRRRR(RR((s:/usr/lib/python2.7/site-packages/salt/proxy/rest_sample.pytservice_restartvs-cC@s1tjjjtdddddt�}|dS(u,
    List "services" on the REST server
    uurluservice/listRujsonRudict(RRRRRR(R((s:/usr/lib/python2.7/site-packages/salt/proxy/rest_sample.pytservice_list~s)cC@s5tjjjtdd|dddt�}|dS(u:
    Check if a service is running on the REST server
    uurluservice/status/RujsonRudict(RRRRRR(RR((s:/usr/lib/python2.7/site-packages/salt/proxy/rest_sample.pytservice_status�s-cC@s1tjjjtdddddt�}|dS(u6
    List "packages" installed on the REST server
    uurlupackage/listRujsonRudict(RRRRRR(R((s:/usr/lib/python2.7/site-packages/salt/proxy/rest_sample.pytpackage_list�s)cK@sltdd|}|jdt�r9|d|d7}n
|d7}tjjj|dddt�}|d	S(
u0
    Install a "package" on the REST server
    uurlupackage/install/uversionu/u/1.0RujsonRudict(RRRRRRRR(RtkwargstcmdR((s:/usr/lib/python2.7/site-packages/salt/proxy/rest_sample.pytpackage_install�s
!cC@s!tjjjtdd�}|S(Nuurlu
fix_outage(RRRRR(R((s:/usr/lib/python2.7/site-packages/salt/proxy/rest_sample.pyt
fix_outage�scC@s5tjjjtdd|dddt�}|dS(uW
    Call the REST endpoint to see if the packages on the "server" are up to date.
    uurlupackage/remove/RujsonRudict(RRRRRR(RR((s:/usr/lib/python2.7/site-packages/salt/proxy/rest_sample.pytuptodate�s-cC@s5tjjjtdd|dddt�}|dS(u/
    Remove a "package" on the REST server
    uurlupackage/remove/RujsonRudict(RRRRRR(RR((s:/usr/lib/python2.7/site-packages/salt/proxy/rest_sample.pytpackage_remove�s-cC@s5tjjjtdd|dddt�}|dS(uG
    Check the installation status of a package on the REST server
    uurlupackage/status/RujsonRudict(RRRRRR(RR((s:/usr/lib/python2.7/site-packages/salt/proxy/rest_sample.pytpackage_status�s-cC@sZtjjjtdddddt�}y|djdt�SWntk
rUtSXdS(	u 
    Is the REST server up?
    uurlupingRujsonRudicturetN(	RRRRRRRRt	Exception(R((s:/usr/lib/python2.7/site-packages/salt/proxy/rest_sample.pyR�s
)
cC@stjd�dS(u,
    For this proxy shutdown is a no-op
    u&rest_sample proxy shutdown() called...N(RR(R	((s:/usr/lib/python2.7/site-packages/salt/proxy/rest_sample.pytshutdown�scC@stjd�dS(uN
    Test function so we have something to call from a state
    :return:
    utest_from_state calledu	testvalue(RR(((s:/usr/lib/python2.7/site-packages/salt/proxy/rest_sample.pyttest_from_state�s
(&t__doc__t
__future__RRRtloggingtsalt.utils.httpRRtHAS_REST_EXAMPLEt__proxyenabled__tGRAINS_CACHERt	getLoggert__file__RRR
R
RRRRRRRR R!R"R#R&R'R(R)R*RR,R-(((s:/usr/lib/python2.7/site-packages/salt/proxy/rest_sample.pyt<module>s<							
	
									
								

Zerion Mini Shell 1.0