action warning

Mode: Configuration Mode

Description:

If the candidate configuration does not satisfy all constraints specified in the action warning function, a warning is displayed when user attempts to commit or display the candidate configuration.

Example:

src/junos/lib/ddl/junos-actions/junos_foreign.c

        /* mgd_undefined_class_warning(): print a warning if an class */
        /* is undefined */
        DDL_ACTION_FUNCTION(mgd_undefined_class_warning)
        {
            if (daap->daa_argv[0] == NULL) {
                DBG_FOREIGN("mgd_undefined_make_warning: null daa_argv[0]");
                return 0;
            }

            if (is_predefined_class(daap->daa_argv[0]))
                return 0;

            return ddl_warn_undefined_path_reference(daap);
        }

src/junos/lib/ddl/input/exampled.cnf.dd

        object newbie {
            help "Newbie settings";

            attribute login-class {
                help "Newbie's login class";
                path-reference "system login class";
                action warning mgd mgd_undefined_class_warning;
                type string;
            }
        }

Display:

        user@router# set example newbie login-class ipg         

        [edit]
        user@router# show example 
        newbie {
            login-class ipg; ## 'ipg' is not defined
        }

        [edit]
        user@router# show
        [edit example]
          'newbie'
            Undefined class 'ipg' for user 'unknown'
        error: configuration check-out failed

        [edit]
        user@router# set example newbie login-class operator
        
        [edit]
        user@router# show example
        newbie {
            login-class operator;
        }

        [edit]
        user@router# commit
        commit complete

        user@router#

Topics for further reading:

See also:

Reference (to programmers guide/style guide):


2007-2008 Juniper Networks, Inc. All rights reserved. The information contained herein is confidential information of Juniper Networks, Inc., and may not be used, disclosed, distributed, modified, or copied without the prior written consent of Juniper Networks, Inc. in an express license. This information is subject to change by Juniper Networks, Inc. Juniper Networks, the Juniper Networks logo, and JUNOS are trademarks of Juniper Networks, Inc.
Generated on Sun May 30 20:23:12 2010 for DDL Reference Guide by doxygen 1.4.5