huskar_api/api/service_route.py
def put(self, application_name):
        """Creates or updates a default route policy of specific application.

        :param application_name: The name of specific application.
        :form ezone: Optional. The ezone of default route. Default: ``overall``
        :form intent: Optional. The intent of default route. Default:
                      ``direct``
        :form cluster_name: The name of destination cluster. The cluster name
                            must not be ezone prefixed.
        :<header Authorization: Huskar Token (See :ref:`token`)
        :status 200: Operation success.
        """
        check_application_auth(application_name, Authority.WRITE)
        ezone = request.form.get('ezone') or OVERALL
        intent = request.form.get('intent') or ROUTE_DEFAULT_INTENT
        cluster_name = request.form['cluster_name']
        check_cluster_name(cluster_name, application_name)
        facade = RouteManagement(huskar_client, application_name, None)
        try:
            default_route = facade.set_default_route(
                ezone, intent, cluster_name)
        except ValueError as e:
            # TODO: Use a better validator instead
            return api_response(
                status='InvalidArgument', message=first(e.args, '')), 400
        audit_log.emit(
            audit_log.types.UPDATE_DEFAULT_ROUTE,
            application_name=application_name, ezone=ezone, intent=intent,
            cluster_name=cluster_name)
        return api_response({
            'default_route': default_route,
            'global_default_route': settings.ROUTE_DEFAULT_POLICY})
Creates or updates a default route policy of specific application.

        :param application_name: The name of specific application.
        :form ezone: Optional. The ezone of default route. Default: ``overall``
        :form intent: Optional. The intent of default route. Default:
                      ``direct``
        :form cluster_name: The name of destination cluster. The cluster name
                            must not be ezone prefixed.
        :<header Authorization: Huskar Token (See :ref:`token`)
        :status 200: Operation success.
        
Creates or updates a default route policy of specific application.
Creates or updates a default route policy of specific application .
def put(self, application_name):
        check_application_auth(application_name, Authority.WRITE)
        ezone = request.form.get('ezone') or OVERALL
        intent = request.form.get('intent') or ROUTE_DEFAULT_INTENT
        cluster_name = request.form['cluster_name']
        check_cluster_name(cluster_name, application_name)
        facade = RouteManagement(huskar_client, application_name, None)
        try:
            default_route = facade.set_default_route(
                ezone, intent, cluster_name)
        except ValueError as e:
            return api_response(
                status='InvalidArgument', message=first(e.args, '')), 400
        audit_log.emit(
            audit_log.types.UPDATE_DEFAULT_ROUTE,
            application_name=application_name, ezone=ezone, intent=intent,
            cluster_name=cluster_name)
        return api_response({
            'default_route': default_route,
            'global_default_route': settings.ROUTE_DEFAULT_POLICY})
def put ( self , application_name ) : check_application_auth ( application_name , Authority . WRITE ) ezone = request . form . get ( 'ezone' ) or OVERALL intent = request . form . get ( 'intent' ) or ROUTE_DEFAULT_INTENT cluster_name = request . form [ 'cluster_name' ] check_cluster_name ( cluster_name , application_name ) facade = RouteManagement ( huskar_client , application_name , None ) try : default_route = facade . set_default_route ( ezone , intent , cluster_name ) except ValueError as e : return api_response ( status = 'InvalidArgument' , message = first ( e . args , '' ) ) , 400 audit_log . emit ( audit_log . types . UPDATE_DEFAULT_ROUTE , application_name = application_name , ezone = ezone , intent = intent , cluster_name = cluster_name ) return api_response ( { 'default_route' : default_route , 'global_default_route' : settings . ROUTE_DEFAULT_POLICY } )
Creates or updates a default route policy of specific application.
Creates or updates a default route policy of specific application .
"""Creates or updates a default route policy of specific application.

        :param application_name: The name of specific application.
        :form ezone: Optional. The ezone of default route. Default: ``overall``
        :form intent: Optional. The intent of default route. Default:
                      ``direct``
        :form cluster_name: The name of destination cluster. The cluster name
                            must not be ezone prefixed.
        :<header Authorization: Huskar Token (See :ref:`token`)
        :status 200: Operation success.
        """ # TODO: Use a better validator instead
self
application_name
The name of specific application.
The name of specific application .
form
Optional. The ezone of default route. Default: ``overall``
Optional . The ezone of default route . Default : ` ` overall ` `
form
Optional. The intent of default route. Default:
``direct``
Optional . The intent of default route . Default : ` ` direct ` `
form
The name of destination cluster. The cluster name
must not be ezone prefixed.
The name of destination cluster . The cluster name must not be ezone prefixed .
<header
Huskar Token (See :ref:`token`)
Huskar Token ( See : ref : ` token ` )
status
None