tmsh::get_field_names

Description

Returns a list of field names (not the value associated with a field) that are present in an object. value fields are simple values or lists, for example, and integer or a string. nested fields are a collection of zero or more nested objects, where the nested objects have their own fields, for example, pool members and virtual server profiles. The $obj argument must be an object that was returned by either of the following Tcl commands:


If the object was retrieved using the Tcl command tmsh::get_config the field names are identical to those that are displayed by the tmsh command list. If the object was retrieved using the Tcl command tmsh::get_status the fields are identical to those that the system displays using the tmsh command show with the field-fmt option.

Syntax

tmsh::get_field_names [value | nested] $obj

Examples

proc print_fields { objVar } {
    upvar $objVar obj
    set fdx 0
    set fields [tmsh::get_field_names value $obj]
    set field_count [llength $fields]
    while { $fdx < $field_count } {
        set field [lindex $fields $fdx]
        puts [format $::field_fmt $field [tmsh::get_field_value $obj $field]]
        incr fdx
    }
}