Attribute Definition
Contents
cla140
Contents
An attribute is an item of data related to a component. Attributes are defined in the scope of a group. The syntax of the attribute definition is:
start attribute name = "attribute name" id = nnn [description = "description string"] type = datatype [access = method] [storage = storagetype] [value = [v | * "name" | "enum string"]] end attribute
The required id statement must have a value that is unique among all other attributes in the group. Groups must have at least one attribute definition. Many attribute definitions can appear in the group definition.
Type Statement
The mandatory type statement in the attribute definition describes the storage and semantic characteristics of the attribute being defined. The syntax is:
type = datatype
Datatype is usually one of the data types previously defined.
A data type may be an enumeration; stored and treated as a signed 32-bit integer. Enumerations that have been previously defined (at the component level) can be referenced by name, as if they were a type, for example: type = "Color." Enumerations may also be constructed "in line":
type = start enum (enum definition end enum
In this case, the enumeration does not need a name, since it cannot be referred to outside the scope of this attribute definition. Any name given is ignored.
Only one type statement can appear in the attribute definition.
Access Statement
The optional access statement determines whether the attribute value can be read or written.
The syntax is:
access = method
- MethodSpecifies whether the access is read-only, read-write, or write-only. If the access statement is not specified, the default access is read-only. Attributes marked as keys cannot be write-only. Only one access statement can appear in the attribute definition.
Storage Statement
The optional storage statement provides a hint to management applications to assist in optimizing storage requirements.
The syntax is:
storage = where
- WhereSpecifies the storage area. It can be common or specific. Common signifies that the value of this attribute is typically limited to a small set of possibilities. An example of common can be the clock speed of a CPU. Specific signifies that the value of this attribute is probably not a good candidate for optimization, because there can be many different values. An example of a specific attribute would be a component's serial number.
If the storage statement is not specified, the default storage is specific. Only one storage statement can appear in the attribute definition.
Value Statement
The value statement provides a value or value access mechanism.
The syntax is:
value = v value = "enumeration value" value = * "Name" value = unsupported
- vSpecifies that the attribute is read-only, which never change. For example, the manufacturer of a component, or for read-write attributes, which the Service Layer can handle, as opposed to the component instrumentation. Specifying v for write-only attributes is prohibited. The value v must be specified in the correct data type for the attribute; for example, dates and literal strings must be specified in double quotes.
- "enumeration value"Specifies that the value is an enumeration string which the Service Layer maps to an integer. This value is enclosed within double quotes. The mapping must have been previously defined in an enum definition in this component or attribute definition, and the attribute's type must be an enumeration. Specifying an enumeration value for write-only attributes is prohibited.Specifying an integer for an enumeration is acceptable.
- * "Name"Indicates the symbolic name of the component instrumentation code to invoke to read or write the attribute at runtime. The symbolic name must have been previously defined in a path definition in this component definition. The value * "Name" has a name with an asterisk (*) before it and surrounded by double quotes.
The value unsupported (reserved keyword) can be put in to tell the Service Layer that this attribute is not supported by this component.
The value statement is required except when table templates are defined, when it is optional. If a value is provided in a template, it becomes the default value when populating the table. If it is not provided, there is no default value.
Example: Example of a group with two attributes
Start Group Name = "Software Template" Class = "DMTF|Software Example|1" Key = 1 // key on Product Name Start Attribute ID = 1 Name = "Product Name" Description = "The name of the product" Storage = Common Type = String(64) End Attribute Start Attribute ID = 2 Name = "Product Version" Description = "The product's version number" Type = String(32) Value = "" End Attribute End Group
In this example, the group is acting as a template, as there is no group ID but a key is specified. The default value for the version is an empty string. There is no default for the product name.