for _, vs := range vservers.VirtualServers {
fmt.Printf(" Name: %s Virtual Server type is %s %s\n ", vs.Name, vs.IPProtocol, vs.Rules)
vs := VirtualServer{"Name", "Partition", "FullPath", 1, []string{"/Common/Tetration_TCP_L4_ipfix"}}
//vs.Description = "Modified Sanjay Shitole"
f5.ModifyVirtualServer(vs.Name, &vs)
}
go run f5gohello.go
# command-line-arguments
./f5gohello.go:175:9: undefined: VirtualServer
SJC-ML-00028512:tet shitole$
The function is at https://github.com/f5devcentral/terraform-provider-bigip/blob/master/vendor/github.com/f5devcentral/go-bigip/ltm.go
My example is not to be copied as is. The error comes from the fact that VirtualServer struct is to be imported from an other package, the same as ModifyVirtualServer. You should prefix VirtualServer with its package name as well as for ModifyVirtualServer.
for _, vs := range vservers.VirtualServers {
fmt.Printf(" Name: %s Virtual Server type is %s %s\n ", vs.Name, vs.IPProtocol, vs.Rules)
vs.Rules = []string{"/Common/Tetration_TCP_L4_ipfix"}
//vs.Description = "Modified Sanjay Shitole"
f5.ModifyVirtualServer(vs.Name, &vs)
}
}
go run f5gohello.go
TCP iRule exists on your local machine
UDP iRule exists on your local machine
Attempting to connect...
Checking TCP irule exists on bigip ......
Name: Tetration_TCP_L4_ipfix
TCP irule Exists on BIG-IP