huskar_api/api/support.py
def post(self):
        """Changes the stage of route program.

        The site admin authority is required. See :ref:`application_auth` also.

        :<header Authorization: Huskar Token (See :ref:`token`)
        :form application: The name of application
        :form stage: **D**isabled / **C**hecking / **E**nabled /
                     **S**tandardalone.
        :status 400: The parameters are invalid.
        :status 409: The list is modifying by another request.
        :status 200: The operation is success.
        """
        name = request.form['application']
        stage = request.form.get('stage', type=RouteHijack.Mode)
        cluster_name = request.form.get('cluster', OVERALL)
        cluster_list = {OVERALL}.union(self._make_im().list_cluster_names())
        if stage is None:
            abort(400, 'stage is invalid')
        if cluster_name not in cluster_list:
            abort(400, 'cluster is invalid')
        try:
            g.auth.require_admin()
            check_application(name)
        except NoAuthError:
            check_application_auth(name, Authority.WRITE)
        with self._update_hijack_list(cluster_name) as hijack_list:
            old_stage = hijack_list.pop(name, RouteHijack.Mode.disabled.value)
            hijack_list[name] = stage.value
        if old_stage != stage.value:
            audit_log.emit(
                audit_log.types.PROGRAM_UPDATE_ROUTE_STAGE,
                application_name=name, old_stage=old_stage,
                new_stage=stage.value)
        return api_response({'route_stage': hijack_list})
Changes the stage of route program.

        The site admin authority is required. See :ref:`application_auth` also.

        :<header Authorization: Huskar Token (See :ref:`token`)
        :form application: The name of application
        :form stage: **D**isabled / **C**hecking / **E**nabled /
                     **S**tandardalone.
        :status 400: The parameters are invalid.
        :status 409: The list is modifying by another request.
        :status 200: The operation is success.
        
Changes the stage of route program.
The site admin authority is required.
Changes the stage of route program . The site admin authority is required .
def post(self):
        name = request.form['application']
        stage = request.form.get('stage', type=RouteHijack.Mode)
        cluster_name = request.form.get('cluster', OVERALL)
        cluster_list = {OVERALL}.union(self._make_im().list_cluster_names())
        if stage is None:
            abort(400, 'stage is invalid')
        if cluster_name not in cluster_list:
            abort(400, 'cluster is invalid')
        try:
            g.auth.require_admin()
            check_application(name)
        except NoAuthError:
            check_application_auth(name, Authority.WRITE)
        with self._update_hijack_list(cluster_name) as hijack_list:
            old_stage = hijack_list.pop(name, RouteHijack.Mode.disabled.value)
            hijack_list[name] = stage.value
        if old_stage != stage.value:
            audit_log.emit(
                audit_log.types.PROGRAM_UPDATE_ROUTE_STAGE,
                application_name=name, old_stage=old_stage,
                new_stage=stage.value)
        return api_response({'route_stage': hijack_list})
def post ( self ) : name = request . form [ 'application' ] stage = request . form . get ( 'stage' , type = RouteHijack . Mode ) cluster_name = request . form . get ( 'cluster' , OVERALL ) cluster_list = { OVERALL } . union ( self . _make_im ( ) . list_cluster_names ( ) ) if stage is None : abort ( 400 , 'stage is invalid' ) if cluster_name not in cluster_list : abort ( 400 , 'cluster is invalid' ) try : g . auth . require_admin ( ) check_application ( name ) except NoAuthError : check_application_auth ( name , Authority . WRITE ) with self . _update_hijack_list ( cluster_name ) as hijack_list : old_stage = hijack_list . pop ( name , RouteHijack . Mode . disabled . value ) hijack_list [ name ] = stage . value if old_stage != stage . value : audit_log . emit ( audit_log . types . PROGRAM_UPDATE_ROUTE_STAGE , application_name = name , old_stage = old_stage , new_stage = stage . value ) return api_response ( { 'route_stage' : hijack_list } )
Changes the stage of route program.
Changes the stage of route program .
"""Changes the stage of route program.

        The site admin authority is required. See :ref:`application_auth` also.

        :<header Authorization: Huskar Token (See :ref:`token`)
        :form application: The name of application
        :form stage: **D**isabled / **C**hecking / **E**nabled /
                     **S**tandardalone.
        :status 400: The parameters are invalid.
        :status 409: The list is modifying by another request.
        :status 200: The operation is success.
        """
self
<header
Huskar Token (See :ref:`token`)
Huskar Token ( See : ref : ` token ` )
form
The name of application
The name of application
form
D**isabled / **C**hecking / **E**nabled
S**tandardalone.
D ** isabled / ** C ** hecking / ** E ** nabled S ** tandardalone .
status
The parameters are invalid.
The parameters are invalid .
status
The list is modifying by another request.
The list is modifying by another request .
status
The operation is success.
The operation is success .