%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/marathon.pyc

�
���^c@@s�dZddlmZmZmZddlZddlZddlZddl	Zddl
mZdgZej
e�Zd�Zd�Zd�Zd	�Zd
�Zd�Zd�Zd
�Zd�Zeed�ZdS(u�
Module providing a simple management interface to a marathon cluster.

Currently this only works when run through a proxy minion.

.. versionadded:: 2015.8.2
i(tabsolute_importtprint_functiontunicode_literalsN(tget_error_messageumarathoncC@s,tjjj�r"dtkr"tStdfS(NuproxyuQThe marathon execution module cannot be loaded: this only works on proxy minions.(tsalttutilstplatformtis_proxyt__opts__tTruetFalse(((s9/usr/lib/python2.7/site-packages/salt/modules/marathon.pyt__virtual__scC@s/d}dtkr+tdjd|�}n|S(u/
    Return the proxy configured base url.
    uhttp://locahost:8080uproxyubase_url(Rtget(tbase_url((s9/usr/lib/python2.7/site-packages/salt/modules/marathon.pyt	_base_url$scC@s&|ddkr"dj|�}n|S(u8
    Make sure the app_id is in the correct format.
    iu/u/{0}(tformat(tapp_id((s9/usr/lib/python2.7/site-packages/salt/modules/marathon.pyt_app_id.scC@sWtjjjdjt��dddt�}ig|ddD]}|d^q?d6S(u�
    Return a list of the currently installed app ids.

    CLI Example:

    .. code-block:: bash

        salt marathon-minion-id marathon.apps
    u{0}/v2/appstdecode_typeujsontdecodeudictuappsuid(RRthttptqueryRRR	(tresponsetapp((s9/usr/lib/python2.7/site-packages/salt/modules/marathon.pytapps7s

	cC@st|�t�dkS(u�
    Return whether the given app id is currently configured.

    CLI Example:

    .. code-block:: bash

        salt marathon-minion-id marathon.has_app my-app
    uapps(RR(tid((s9/usr/lib/python2.7/site-packages/salt/modules/marathon.pythas_appIs
cC@s8tjjjdjt�|�dddt�}|dS(u�
    Return the current server configuration for the specified app.

    CLI Example:

    .. code-block:: bash

        salt marathon-minion-id marathon.app my-app
    u{0}/v2/apps/{1}RujsonRudict(RRRRRRR	(RR((s9/usr/lib/python2.7/site-packages/salt/modules/marathon.pyRVs

	cC@s�d|kr||d<n|jdd�|jdd�tjjj|�}yltjjjdjt	�|�ddddd	t
d
|didd
6dd6�}tjd|�|dSWn>t
k
r�}tjdt|��iit|�d6d6SXdS(u�
    Update the specified app with the given configuration.

    CLI Example:

    .. code-block:: bash

        salt marathon-minion-id marathon.update_app my-app '<config yaml>'
    uiduversionufetchu{0}/v2/apps/{1}?force=truetmethoduPUTRujsonRtdatatheader_dictuapplication/jsonuContent-TypeuAcceptuupdate response: %sudictu!unable to update marathon app: %sumessageu	exceptionN(tpoptNoneRRtjsontdumpsRRRRR	tlogtdebugt	ExceptionterrorR(RtconfigRRtex((s9/usr/lib/python2.7/site-packages/salt/modules/marathon.pyt
update_apphs,


cC@s>tjjjdjt�|�dddddt�}|dS(u�
    Remove the specified app from the server.

    CLI Example:

    .. code-block:: bash

        salt marathon-minion-id marathon.rm_app my-app
    u{0}/v2/apps/{1}RuDELETERujsonRudict(RRRRRRR	(RR((s9/usr/lib/python2.7/site-packages/salt/modules/marathon.pytrm_app�s
	cC@s5tjjjdjt��dddt�}|dS(u�
    Return configuration and status information about the marathon instance.

    CLI Example:

    .. code-block:: bash

        salt marathon-minion-id marathon.info
    u{0}/v2/infoRujsonRudict(RRRRRRR	(R((s9/usr/lib/python2.7/site-packages/salt/modules/marathon.pytinfo�s

	cC@s�idd6}|s!t|d<|Sy�tjjjdjt�t|�|�dddddt	did	d
6d	d6�}t
jd|�t	|d<|j|d
�|SWn8t
k
r�}t
jd|j�ii|jd6d6SXdS(u�
    Restart the current server configuration for the specified app.

    :param restart: Restart the app
    :param force: Override the current deployment

    CLI Example:

    .. code-block:: bash

        salt marathon-minion-id marathon.restart_app my-app

    By default, this will only check if the app exists in marathon. It does
    not check if there are any tasks associated with it or if the app is suspended.

    .. code-block:: bash

        salt marathon-minion-id marathon.restart_app my-app true true

    The restart option needs to be set to True to actually issue a rolling
    restart to marathon.

    The force option tells marathon to ignore the current app deployment if
    there is one.
    u	restartedu!{0}/v2/apps/{1}/restart?force={2}RuPOSTRujsonRRuapplication/jsonuContent-TypeuAccepturestart response: %sudictu"unable to restart marathon app: %sumessageu	exceptionN(RR
RRRRRRRR	R"R#tupdateR$R%tmessage(RtrestarttforcetretRR'((s9/usr/lib/python2.7/site-packages/salt/modules/marathon.pytrestart_app�s,



(t__doc__t
__future__RRRtloggingtsalt.utils.httpRtsalt.utils.jsontsalt.utils.platformtsalt.exceptionsRt__proxyenabled__t	getLoggert__file__R"RRRRRRR(R)R*R
R	R0(((s9/usr/lib/python2.7/site-packages/salt/modules/marathon.pyt<module>s$			
				
		(		

Zerion Mini Shell 1.0