Forum Discussion
Sean_Ellis_9378
Nimbostratus
Sep 26, 2012Dumping contents of a class
I have a few classes which I need to retrieve from some BIG-IP systems. I would like to do this via curl, so I set up a virtual service on each and applied an iRule. Here is the TCL I was testing with, which crashed and restarted TMM on the first BIG-IP I tested with. Anyone see the error or know of a way to do this? Thanks in advance!
when HTTP_REQUEST {
set testVersion "8"
set testResponse "Virtual Service Testing - move along"
other code snippets removed
if { $testVersion == 8 } {
set testResponse ".html..head..title.Dump Class./title../head..body..pre.(newline)"
set tv1db "rdDB"
if {[class exists $tv1db]} {
set tv1dbElement [class startsearch $tv1db]
while {[class anymore $tv1db $tv1dbElement]} {
append testResponse [class nextelement $tv1db $tv1dbElement]
append testResponse "(newline)"
}
}
append testResponse "./pre../body../html."
class donesearch $tv1db $tv1dbElement
}
HTTP::respond 200 content $testResponse "Content-Type" "text/plain" "pragma" "no-cache"
TCP::close
}
- Kevin_Stewart
Employee
Not sure about the error, but there's probably a simpler way to get class values using the 'class get' command:when HTTP_REQUEST { set tv1db "rdDB" if { [class exists $tv1db] } { set testResponse "\n" foreach x [class get $tv1db] { append testResponse $x "\n" } HTTP::respond 200 content $testResponse "Content-Type" "text/html" "pragma" "no-cache" "Connection" "Close" } }
- Sean_Ellis_9378
Nimbostratus
Thanks, that worked like a charm.
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