Beispiel #1
0
func NewClient(httpClient *http.Client) *Client {
	c := packngo.NewClient("", "", httpClient)
	c.BaseURL, _ = url.Parse(baseUrl)
	return &Client{
		client:   c,
		Metadata: &MetadataServiceOp{client: c},
		Userdata: &UserdataServiceOp{client: c},
	}
}
Beispiel #2
0
// Client() returns a new client for accessing packet.
func (c *Config) Client() *packngo.Client {
	return packngo.NewClient(consumerToken, c.AuthToken, &http.Client{})
}
Beispiel #3
0
// Client() returns a new client for accessing Packet's API.
func (c *Config) Client() *packngo.Client {
	return packngo.NewClient(consumerToken, c.AuthToken, cleanhttp.DefaultClient())
}
func providerConfigure(d *schema.ResourceData) (interface{}, error) {
	const (
		consumerToken = "aZ9GmqHTPtxevvFq9SK3Pi2yr9YCbRzduCSXF2SNem5sjB91mDq7Th3ZwTtRqMWZ"
	)
	return packngo.NewClient(consumerToken, d.Get("api_key").(string)), nil
}
func (d *Driver) getClient() *packngo.Client {
	return packngo.NewClient(consumerToken, d.ApiKey, nil)
}