opentofu/builtin/providers/cloudstack/config.go
Sander van Harmelen 7b16c44cc2 provider/cloudstack: make timeout configurable
Seems some platforms need more time, so make it configurable with a
sane default…
2015-01-12 15:57:24 +01:00

20 lines
489 B
Go

package cloudstack
import "github.com/xanzy/go-cloudstack/cloudstack"
// Config is the configuration structure used to instantiate a
// new CloudStack client.
type Config struct {
ApiURL string
ApiKey string
SecretKey string
Timeout int64
}
// Client() returns a new CloudStack client.
func (c *Config) NewClient() (*cloudstack.CloudStackClient, error) {
cs := cloudstack.NewAsyncClient(c.ApiURL, c.ApiKey, c.SecretKey, false)
cs.AsyncTimeout(c.Timeout)
return cs, nil
}