summaryrefslogtreecommitdiff
path: root/vendor/github.com/mitchellh/packer/vendor/github.com/profitbricks/profitbricks-sdk-go/nic.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/mitchellh/packer/vendor/github.com/profitbricks/profitbricks-sdk-go/nic.go')
-rw-r--r--vendor/github.com/mitchellh/packer/vendor/github.com/profitbricks/profitbricks-sdk-go/nic.go25
1 files changed, 13 insertions, 12 deletions
diff --git a/vendor/github.com/mitchellh/packer/vendor/github.com/profitbricks/profitbricks-sdk-go/nic.go b/vendor/github.com/mitchellh/packer/vendor/github.com/profitbricks/profitbricks-sdk-go/nic.go
index 74764f56..3c0a0225 100644
--- a/vendor/github.com/mitchellh/packer/vendor/github.com/profitbricks/profitbricks-sdk-go/nic.go
+++ b/vendor/github.com/mitchellh/packer/vendor/github.com/profitbricks/profitbricks-sdk-go/nic.go
@@ -7,24 +7,25 @@ import (
)
type Nic struct {
- Id string `json:"id,omitempty"`
- Type_ string `json:"type,omitempty"`
- Href string `json:"href,omitempty"`
- Metadata *DatacenterElementMetadata `json:"metadata,omitempty"`
- Properties NicProperties `json:"properties,omitempty"`
- Entities *NicEntities `json:"entities,omitempty"`
- Response string `json:"Response,omitempty"`
- Headers *http.Header `json:"headers,omitempty"`
- StatusCode int `json:"headers,omitempty"`
+ Id string `json:"id,omitempty"`
+ Type_ string `json:"type,omitempty"`
+ Href string `json:"href,omitempty"`
+ Metadata *Metadata `json:"metadata,omitempty"`
+ Properties *NicProperties `json:"properties,omitempty"`
+ Entities *NicEntities `json:"entities,omitempty"`
+ Response string `json:"Response,omitempty"`
+ Headers *http.Header `json:"headers,omitempty"`
+ StatusCode int `json:"headers,omitempty"`
}
type NicProperties struct {
Name string `json:"name,omitempty"`
Mac string `json:"mac,omitempty"`
Ips []string `json:"ips,omitempty"`
- Dhcp bool `json:"dhcp,omitempty"`
+ Dhcp bool `json:"dhcp"`
Lan int `json:"lan,omitempty"`
FirewallActive bool `json:"firewallActive,omitempty"`
+ Nat bool `json:"nat,omitempty"`
}
type NicEntities struct {
@@ -56,8 +57,8 @@ func ListNics(dcid, srvid string) Nics {
// CreateNic creates a nic on a server
// from a jason []byte and returns a Instance struct
-func CreateNic(dcid string, srvid string, request Nic) Nic {
- obj, _ := json.Marshal(request)
+func CreateNic(dcid string, srvid string, nic Nic) Nic {
+ obj, _ := json.Marshal(nic)
path := nic_col_path(dcid, srvid)
url := mk_url(path) + `?depth=` + Depth
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(obj))