summaryrefslogtreecommitdiff
path: root/vendor/github.com/mitchellh/packer/builder/oracle/oci/client/client.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/mitchellh/packer/builder/oracle/oci/client/client.go')
-rw-r--r--vendor/github.com/mitchellh/packer/builder/oracle/oci/client/client.go31
1 files changed, 31 insertions, 0 deletions
diff --git a/vendor/github.com/mitchellh/packer/builder/oracle/oci/client/client.go b/vendor/github.com/mitchellh/packer/builder/oracle/oci/client/client.go
new file mode 100644
index 00000000..8e6c1762
--- /dev/null
+++ b/vendor/github.com/mitchellh/packer/builder/oracle/oci/client/client.go
@@ -0,0 +1,31 @@
+package oci
+
+import (
+ "net/http"
+)
+
+const (
+ apiVersion = "20160918"
+ userAgent = "go-oci/" + apiVersion
+ baseURLPattern = "https://%s.%s.oraclecloud.com/%s/"
+)
+
+// Client is the main interface through which consumers interact with the OCI
+// API.
+type Client struct {
+ UserAgent string
+ Compute *ComputeClient
+ Config *Config
+}
+
+// NewClient creates a new Client for communicating with the OCI API.
+func NewClient(config *Config) (*Client, error) {
+ transport := NewTransport(http.DefaultTransport, config)
+ base := newBaseClient().Client(&http.Client{Transport: transport})
+
+ return &Client{
+ UserAgent: userAgent,
+ Compute: NewComputeClient(base.New().Base(config.getBaseURL("iaas"))),
+ Config: config,
+ }, nil
+}