must (any "... <*> ...")

Mode: Configuration Mode

Description:

For element objects (flag setof list), each element is identified by the user-defined name. Many times, it is necessary to examine ddl contents inside these element objects. 'any' is used to ensure that at least one of the instances of the element objects satisfies the constraint.

Similarly, '! any' only succeeds when none of the elements satisfy the constraint.

Example 1:

        object newbo {
            help "Newbo section";
            product olive;

            object uid {
                help "Newbo user ID";
                type uint;
                must (! any "newbie <*> uid $$");
                must-message "This uid is already used by a newbie";
            }
        }

        object newbie {
            help "Newbie section";
            flag setof list;
            product olive;

            attribute name {
                help "Name of the newbie user";
                xml-name newbie-name;
                flag identifier nokeyword;
                type string;
            }
            attribute uid {
                help "Newbie user ID";
                type uint;
            }
        }

Display 1:

        user@router# set newbo uid 3;

        [edit]
        user@router@ set newbie felix uid 5

        [edit]
        user@router# show
        version "9.1I0 [user]";
        newbo {
            uid 3;
        }
        newbie felix {
            uid 5;
        }
        
        [edit]
        user@router# set newbie felix uid 3

        [edit]
        user@router# show
        version "9.1I0 [user]";
        newbo {
        ##
        ## Warning: This uid is already used by a newbie
        ##
            uid 3;
        }
        newbie felix {
            uid 3;
        }

        [edit]
        user@router# commit check
        [edit newbo]
           'uid'
              This user is already used by a newbie
        error: configuration check-out failed

        [edit]

See also:
must

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