terraform/builtin/providers/cloudstack/config.go

22 lines
548 B
Go
Raw Normal View History

package cloudstack
import "github.com/xanzy/go-cloudstack/cloudstack"
// Config is the configuration structure used to instantiate a
// new CloudStack client.
type Config struct {
2015-07-16 17:40:04 +02:00
APIURL string
APIKey string
SecretKey string
HTTPGETOnly bool
Timeout int64
}
2015-07-16 17:40:04 +02:00
// NewClient returns a new CloudStack client.
func (c *Config) NewClient() (*cloudstack.CloudStackClient, error) {
2015-07-16 17:40:04 +02:00
cs := cloudstack.NewAsyncClient(c.APIURL, c.APIKey, c.SecretKey, false)
cs.HTTPGETOnly = c.HTTPGETOnly
cs.AsyncTimeout(c.Timeout)
return cs, nil
}