action pre-assign

Mode: Configuration Mode

Description:

The pre-action is similar to the action assign statement, which executes the specified function called just after a value is placed in the database. This allows the value to be manipulated, rewritten, or otherwise modified. It is most often invoked after a user performs the set command on a configuration object (stripping paths, converting plain text to encrypted text, and so on.)

The difference is that it also allows the DDL programmer to set a default value. The default value is used when users do not set a value for the CLI knob.

Example:

        object newbie {
            help "Newbie settings";

            attribute hq-timezone {
                help "HQ timezone";
                action pre-assign mgd mgd_timezone_preassign;
                type string;
                default "PST";
            }
        }

Display:

        user@router# set example newbie hq-timezone ?
        Possible completions:
          <hq-timezone>        HQ timezone
        [edit]
        user@router# set example newbie hq-timezone EDT

        [edit]
        user@router# show example
        newbie {
            hq-timezone EDT;
        }
        [edit]

Topics for further reading:

See also:
action_assign.doxy

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