type enum choice

Mode: Configuration Mode

Description:

An enumerated type in DDL is analogous to that in C and other languages: it permits any of several specified values to be used for a given object or attribute. The values are specified using the choice statement.

Using choice with type enum limits the subordinates available under an object or attribute.

Specifying choices for an object or attribute, each allowable option has to be listed in the input file.

Only one of the choices can be configured for the object/attribute, and if one choice is already specified, specifying a second choice will wipe out the setting using the first choice.

This should not be confused with the other usage of the keyword choice.

Example:

        object newbie {
            help "Newbie section";

            attribute gid {
                help "Group ID";
                type enum int {
                    choice apg {
                        help "Member of APG";
                        value 1;
                    }
                    choice ipg {
                        help "Member of IPG";
                        value 2;
                    }
                    choice spg {
                        help "Member of SPG";
                        value 3;
                    }
                }
            }
        }

Display:

        user@router# set newbie ? 
        Possible completions:
          <[Enter]>            Execute this command
          gid                  Group ID
          |                    Pipe through a command
        [edit]
        user@router# set newbie gid ?
        Possible completions:
          apg                  Member of APG
          ipg                  Member of IPG
          spg                  Member of SPG
        [edit]
        user@router# set newbie gid ipg
        
        [edit]
        user@router# show 
        version "8.1I0 [user]";
        newbie {
            gid ipg;
        }

        [edit]
        user@router# set newbie gid spg
        [edit]
        user@router# show 
        version "8.1I0 [user]";
        newbie {
            gid spg;
        }

        [edit]

See also:
choice

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