Forum Discussion
JRahm
Jan 27, 2011Admin
Object not displaying all fields
I'm using a proc from the wiki that prints fields:
proc print_fields { objVar } {
upvar $objVar obj
set fdx 0
set fields [tmsh::get_field_names value $obj]
set field_count [lleng...
Mark_Crosland_2
Jan 28, 2011Historic F5 Account
In the man page, help cli script, it talks about value fields and nested fields. Value fields are simple values or lists. A nested field (the missing profile list) can be used to retrieve nested objects. Nested objects also have fields, in this case the virtual/profile objects have a context field (clientside or serverside). Depending on the type of configuration, a nested object may also contain nested objects.
proc script::run {} {
tmsh::stateless enabled
tmsh::create ltm virtual foo profiles replace-all-with "{ tcp http }"
foreach vip [tmsh::get_config /ltm virtual foo all-properties] {
foreach fld [tmsh::get_field_names value $vip] {
puts "value field: $fld"
}
foreach fld [tmsh::get_field_names nested $vip] {
puts "nested field: $fld"
}
foreach profile [tmsh::get_field_value $vip profiles] {
puts "profile: [tmsh::get_name $profile]"
foreach fld [tmsh::get_field_names value $profile] {
puts " profile field: $fld: [tmsh::get_field_value $profile $fld]"
}
}
}
}
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects