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 forjava.lang.String
. There are no ambiguous type names in the model. For example,x.y.ztype
anda.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 thattrue
orfalse
are appropriate values. Theattr3 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 isALL
,SOME
, orNONE
. The valueA_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 anExampleType5
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 ofExampleType6
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 toExampleType7
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 genericAnimalType
. 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 ofExampleType8
, thebeast
attribute can have a value ofHorseType
,FishType
, orButterflyType
. When you specify an attribute in this way, using a modify or create command, specify the type ofAnimalType
. If you do not specify theAnimalType
, a genericAnimalType
object is assumed (specifying the generic type is possible and legitimate). This is done by specifyingbeast:HorseType
instead ofbeast
.