scottdware / go-bigip

A Go package that interacts with F5 BIG-IP systems using the REST API.
MIT License
108 stars 118 forks source link

ClientTimeout exceeded while awaiting headers #118

Open barryCrunch opened 4 years ago

barryCrunch commented 4 years ago

I'm receiving the following error when trying to pull any Resource. Get "https://<ipaddress>/mgmt/tm/ltm/virtual": context deadline exceeded (Client.Timeout exceeded while awaiting headers)

I'm fairly new to golang so this could very well be something on my side.

Code

package main

import (
        "fmt"
        "github.com/scottdware/go-bigip"
)

func main() {
        config := bigip.ConfigOptions{
                APICallTimeout: 10000,
        }
        f5 := bigip.NewSession("https://<ipaddress>", "user", "password", &config)

        vservers, err := f5.VirtualServers()
        if err != nil {
                fmt.Println("THERE WAS AN ERROR")
                fmt.Println(err)
        }

        fmt.Println(vservers)

        test, err := f5.GetVirtualServer("VS_NAME")
        if err != nil {
                fmt.Println("THERE WAS AN ERROR")
                fmt.Println(err)
        }
        fmt.Println(test)

        for _, vs := range vservers.VirtualServers {
               fmt.Printf("Name: %s\n", vs.Name)
         }
}