Interpreting the output of the AdminConfig attributes command using wsadmin scripting

Use scripting to interpret the output of the AdminConfig attributes command.

Before you begin

Before starting this task, the wsadmin tool must be running. See the topic about starting the wsadmin scripting client.

About this task

The attributes command is a wsadmin tool on-line help feature. When you issue the attributes command, the information that displays does not represent a particular configuration object. It represents information about configuration object types, or object metadata. This topic discusses how to interpret the attribute type display.

Procedure

  • Display simple attributes.

    Using Jacl:

    $AdminConfig attributes ExampleType1
    "attr1 String"
    Using Jython:
    print AdminConfig.attributes('ExampleType1')
    attr1 String

    Types do not display as fully qualified names. For example, String is used for java.lang.String. There are no ambiguous type names in the model. For example, x.y.ztype and a.b.ztype. Using only the final portion of the name is possible, and it makes the output easier to read.

  • Display multiple attributes.

    Using Jacl:

    $AdminConfig attributes ExampleType2
    "attr1 String" "attr2 Boolean" "attr3 Integer"
    Using Jython:
    print AdminConfig.attributes('ExampleType2')
    attr1 String attr2 Boolean attr3 Integer

    All input and output for the scripting client takes place with strings, but attr2 Boolean indicates that true or false are appropriate values. The attr3 Integer indicates that string representations of integers ("42") are needed. Some attributes have string values that can take only one of a small number of predefined values. The wsadmin tool distinguishes these values in the output by the special type name ENUM, for example:

    Using Jacl:

    $AdminConfig attributes ExampleType3
    "attr4 ENUM(ALL, SOME, NONE)"
    Using Jython:
    print AdminConfig.attributes('ExampleType3')
    attr4 ENUM(ALL, SOME, NONE)

    where: attr4 is an ENUM type. When you query or set the attribute, one of the values is ALL, SOME, or NONE. The value A_FEW results in an error.

  • Nested attributes

    Using Jacl:

    $AdminConfig attributes ExampleType4
    "attr5 String" "ex5 ExampleType5"
    Using Jython:
    print AdminConfig.attributes('ExampleType4') 
    attr5 String ex5 ExampleType5

    The ExampleType4 object has two attributes: a string, and an ExampleType5 object. If you do not know what is contained in the ExampleType5 object, you can use another attributes command to find out. The attributes command displays only the attributes that the type contains directly. It does not recursively display the attributes of nested types.

  • Display attributes that represent lists.

    The values of these attributes are object lists of different types. The * character distinguishes these attributes, for example:

    Using Jacl:

    $AdminConfig attributes ExampleType5
    "ex6 ExampleType6*"
    Using Jython:
    print AdminConfig.attributes('ExampleType5')
    ex6 ExampleType6*

    In this example, objects of the ExampleType5 type contain a single attribute, ex6. The value of this attribute is a list of ExampleType6 type objects.

  • Display reference attributes.

    An attribute value that references another object. You cannot change these references using modify commands, but these references display because they are part of the complete representation of the type. Distinguish reference attributes using the @ sign, for example:

    Using Jacl:

    $AdminConfig attributes ExampleType6
    "attr7 Boolean" "ex7 ExampleType7@"
    Using Jython:
    print AdminConfig.attributes('ExampleType6') 
    attr7 Boolean ex7 ExampleType7@

    ExampleType6 objects contain references to ExampleType7 type objects.

  • Display generic attributes.

    These attributes have generic types. The values of these attributes are not necessarily this generic type. These attributes can take values of several different specific types. When you use the AdminConfig attributes command to display the attributes of this object, the various possibilities for specific types are shown in parentheses, for example:

    Using Jacl:
    $AdminConfig attributes ExampleType8
    "name String" "beast AnimalType(HorseType, FishType, ButterflyType)"
    Using Jython:
    print AdminConfig.attributes('ExampleType8')
    name String beast AnimalType(HorseType, FishType, ButterflyType)

    In this example, the beast attribute represents an object of the generic AnimalType. This generic type is associated with three specific subtypes. The wsadmin tool gives these subtypes in parentheses after the name of the base type. In any particular instance of ExampleType8, the beast attribute can have a value of HorseType, FishType, or ButterflyType. When you specify an attribute in this way, using a modify or create command, specify the type of AnimalType. If you do not specify the AnimalType, a generic AnimalType object is assumed (specifying the generic type is possible and legitimate). This is done by specifying beast:HorseType instead of beast.