max-elements

Mode: Configuration Mode

Description:

For objects and attributes that consist of a list (using setof), max-elements limits the number of entries that can be specified.

When the limit is reached, an error message will be printed.

Example:

        object newbie {
            help "Newbie section";

            attribute hosts {
                help "Newbie hosts (maximum 2)";
                type setof ipaddr;
                max-elements 2;
            }
        }

Display:

        user@router# set newbie hosts ?
        Possible completions:
          <value>              Newbie hosts (maximum 2)
          [                    Open a set of values
        [edit]
        user@router# set newbie hosts 1.1.1.1 

        [edit]
        user@router# set newbie hosts 2.2.2.2    

        [edit]
        user@router# show
        version "8.1I0 [user]";
        newbie {
            hosts [ 1.1.1.1 2.2.2.2 ];
        }

        [edit]
        user@router# set newbie hosts 3.3.3.3 

        [edit]
        user@router# show 
        version "8.1I0 [user]";
        newbie {
            ##
            ## Warning: number of elements exceeds limit of 2
            ##
            hosts [ 1.1.1.1 2.2.2.2 3.3.3.3 ];
        }

        [edit]
        user@router# commit check 
        [edit newbie]
          'hosts'
            number of elements exceeds limit of 2
        error: configuration check-out failed: (number of elements exceeds limit)

        [edit]

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