Interpreting the output of the AdminConfig attributes command using wsadmin.sh
Use scripting to interpret the output of the AdminConfig attributes command.
See the topic about starting the wsadmin scripting client.
The attributes command is a wsadmin tool on-line help feature. When we 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.
Tasks
- Display simple attributes.
Use Jacl:
$AdminConfig attributes ExampleType1 "attr1 String"Use Jython:
print AdminConfig.attributes('ExampleType1') attr1 StringTypes 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.
Use Jacl:
$AdminConfig attributes ExampleType2 "attr1 String" "attr2 Boolean" "attr3 Integer"Use Jython:
print AdminConfig.attributes('ExampleType2') attr1 String attr2 Boolean attr3 IntegerAll 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:
Use Jacl:
$AdminConfig attributes ExampleType3 "attr4 ENUM(ALL, SOME, NONE)"Use Jython:
print AdminConfig.attributes('ExampleType3') attr4 ENUM(ALL, SOME, NONE)where: attr4 is an ENUM type. When we query or set the attribute, one of the values is ALL, SOME, or NONE. The value A_FEW results in an error.
- Nested attributes
Use Jacl:
$AdminConfig attributes ExampleType4 "attr5 String" "ex5 ExampleType5"Use Jython:
print AdminConfig.attributes('ExampleType4') attr5 String ex5 ExampleType5The ExampleType4 object has two attributes: a string, and an ExampleType5 object. If we do not know what is contained in the ExampleType5 object, we 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:
Use Jacl:
$AdminConfig attributes ExampleType5 "ex6 ExampleType6*"Use 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. We 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:
Use Jacl:
$AdminConfig attributes ExampleType6 "attr7 Boolean" "ex7 ExampleType7@"Use 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 we use the AdminConfig attributes command to display the attributes of this object, the various possibilities for specific types are shown in parentheses, for example:
Use Jacl:
$AdminConfig attributes ExampleType8 "name String" "beast AnimalType(HorseType, FishType, ButterflyType)"Use 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 we specify an attribute in this way, using a modify or create command, specify the type of AnimalType. If we 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.
Start the wsadmin scripting client wsadmin AdminConfig Commands for the AdminConfig object