stack72 b04796c2cc Bump Joyent/triton-go to modern version of the SDK
This brings packer into the same version of triton-go as that in Terraform, where we rewrote the package from a library with everything in 1 place to individual packages

I was able to successfully provision a machine on triton using this new change, you can find the output in the attached gist

https://gist.github.com/stack72/a64d745459107c5a16bcb156965597ce
2017-10-31 18:08:53 +02:00

40 lines
1.1 KiB
Go

package network
import (
triton "github.com/joyent/triton-go"
"github.com/joyent/triton-go/client"
)
type NetworkClient struct {
Client *client.Client
}
func newNetworkClient(client *client.Client) *NetworkClient {
return &NetworkClient{
Client: client,
}
}
// NewClient returns a new client for working with Network endpoints and
// resources within CloudAPI
func NewClient(config *triton.ClientConfig) (*NetworkClient, error) {
// TODO: Utilize config interface within the function itself
client, err := client.New(config.TritonURL, config.MantaURL, config.AccountName, config.Signers...)
if err != nil {
return nil, err
}
return newNetworkClient(client), nil
}
// Fabrics returns a FabricsClient used for accessing functions pertaining to
// Fabric functionality in the Triton API.
func (c *NetworkClient) Fabrics() *FabricsClient {
return &FabricsClient{c.Client}
}
// Firewall returns a FirewallClient client used for accessing functions
// pertaining to firewall functionality in the Triton API.
func (c *NetworkClient) Firewall() *FirewallClient {
return &FirewallClient{c.Client}
}