Skip to content

Commit a95fb9d

Browse files
committed
IPV6 to IPv6, update readme
1 parent 58443ee commit a95fb9d

5 files changed

+11
-10
lines changed

README.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,17 @@ func main() {
5959
Create a VPS
6060

6161
```go
62-
vpsOptions := &govultr.ServerOptions{
62+
vpsOptions := &govultr.InstanceReq{
6363
Label: "awesome-go-app",
6464
Hostname: "awesome-go.com",
65-
EnablePrivateNetwork: true,
66-
AutoBackups: true,
67-
EnableIPV6: true,
65+
Backups: true,
66+
EnableIPv6: true,
67+
OsID: 362,
68+
Plan: "vc2-1c-2gb",
69+
Region: "ewr",
6870
}
6971

70-
// RegionId, VpsPlanID, OsID can be grabbed from their respective API calls
71-
res, err := vultrClient.Server.Create(context.Background(), 1, 201, 1, vpsOptions)
72+
res, err := vultrClient.Instance.Create(context.Background(), vpsOptions)
7273

7374
if err != nil {
7475
fmt.Println(err)

bare_metal_server.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ type BareMetalReq struct {
6969
OsID int `json:"os_id,omitempty"`
7070
StartupScriptID string `json:"script_id,omitempty"`
7171
SnapshotID string `json:"snapshot_id,omitempty"`
72-
EnableIPV6 string `json:"enable_ipv6,omitempty"`
72+
EnableIPv6 string `json:"enable_ipv6,omitempty"`
7373
Label string `json:"label,omitempty"`
7474
SSHKeyIDs []string `json:"sshkey_id,omitempty"`
7575
AppID int `json:"app_id,omitempty"`

bare_metal_server_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func TestBareMetalServerServiceHandler_Create(t *testing.T) {
111111
Region: "ewr",
112112
Plan: "vbm-4c-32gb",
113113
SnapshotID: "1",
114-
EnableIPV6: "yes",
114+
EnableIPv6: "yes",
115115
Label: "go-bm-test",
116116
SSHKeyIDs: []string{"6b80207b1821f"},
117117
AppID: 1,

instance.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ type InstanceReq struct {
197197
IPXEChainURL string `json:"ipxe_chain_url,omitempty"`
198198
ScriptID string `json:"script_id,omitempty"`
199199
SnapshotID string `json:"snapshot_id,omitempty"`
200-
EnableIPV6 bool `json:"enable_ipv6,omitempty"`
200+
EnableIPv6 bool `json:"enable_ipv6,omitempty"`
201201
AttachPrivateNetwork []string `json:"attach_private_network,omitempty"`
202202
DetachPrivateNetwork []string `json:"detach_private_network,omitempty"`
203203
SSHKey []string `json:"sshkey_id,omitempty"`

instance_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ func TestServerServiceHandler_Create(t *testing.T) {
522522
IPXEChainURL: "test.org",
523523
ISOID: "dev-preview-abc123",
524524
ScriptID: "213",
525-
EnableIPV6: true,
525+
EnableIPv6: true,
526526
Backups: true,
527527
UserData: "dW5vLWRvcy10cmVz",
528528
ActivationEmail: true,

0 commit comments

Comments
 (0)