diff --git a/doc_test.go b/doc_test.go index ac08b29..800b416 100644 --- a/doc_test.go +++ b/doc_test.go @@ -143,7 +143,7 @@ func ExampleIPService_Available() { ips, _ := client.IPs.Available(context.Background(), glesys.AvailableIPsParams{ DataCenter: "Falkenberg", - Platform: "OpenVZ", + Platform: "KVM", Version: 4, }) @@ -455,7 +455,7 @@ func ExampleServerService_Console() { func ExampleServerService_Destroy() { client := glesys.NewClient("CL12345", "your-api-key", "my-application/0.0.1") - client.Servers.Destroy(context.Background(), "vz12345", glesys.DestroyServerParams{ + client.Servers.Destroy(context.Background(), "kvm12345", glesys.DestroyServerParams{ KeepIP: true, // KeepIP defaults to false }) } @@ -463,7 +463,7 @@ func ExampleServerService_Destroy() { func ExampleServerService_Details() { client := glesys.NewClient("CL12345", "your-api-key", "my-application/0.0.1") - server, _ := client.Servers.Details(context.Background(), "vz12345") + server, _ := client.Servers.Details(context.Background(), "kvm12345") fmt.Println(server.Hostname) } @@ -471,7 +471,7 @@ func ExampleServerService_Details() { func ExampleServerService_Edit() { client := glesys.NewClient("CL12345", "your-api-key", "my-application/0.0.1") - server, _ := client.Servers.Edit(context.Background(), "vz12345", glesys.EditServerParams{ + server, _ := client.Servers.Edit(context.Background(), "kvm12345", glesys.EditServerParams{ Bandwidth: 100, CPU: 4, Description: "Web Server", @@ -496,13 +496,13 @@ func ExampleServerService_List() { func ExampleServerService_Start() { client := glesys.NewClient("CL12345", "your-api-key", "my-application/0.0.1") - client.Servers.Start(context.Background(), "vz12345") + client.Servers.Start(context.Background(), "kvm12345") } func ExampleServerService_Stop() { client := glesys.NewClient("CL12345", "your-api-key", "my-application/0.0.1") - client.Servers.Stop(context.Background(), "vz12345", glesys.StopServerParams{ + client.Servers.Stop(context.Background(), "kvm12345", glesys.StopServerParams{ Type: "reboot", // Type "soft", "hard" and "reboot" available }) } diff --git a/ips_test.go b/ips_test.go index 37855c2..125371b 100644 --- a/ips_test.go +++ b/ips_test.go @@ -47,9 +47,9 @@ func TestIPsIsIPv6(t *testing.T) { func TestIPsDetails(t *testing.T) { c := &mockClient{body: `{ "response": { "details": { "ipaddress": "127.0.0.1", "netmask": "None", "broadcast": "None", "gateway": "None", "nameservers": ["127.255.255.1"], - "platform": "OpenVZ", "platforms": ["OpenVZ"], + "platform": "KVM", "platforms": ["KVM"], "cost": {"amount":1, "currency": "SEK", "timeperiod": "month"}, - "datacenter": "Falkenberg", "ipversion": 4, "serverid": "vz123456", "reserved": "yes", + "datacenter": "Falkenberg", "ipversion": 4, "serverid": "kvm123456", "reserved": "yes", "lockedtoaccount": "no", "ptr": "1.0.0.127-static.example.com."} } }`} s := IPService{client: c} @@ -58,7 +58,7 @@ func TestIPsDetails(t *testing.T) { assert.Equal(t, "POST", c.lastMethod, "method used is correct") assert.Equal(t, "ip/details", c.lastPath, "path used is correct") assert.Equal(t, "127.0.0.1", (*ip).Address, "one ip was returned") - assert.Equal(t, "OpenVZ", (*ip).Platform, "platform is correct") + assert.Equal(t, "KVM", (*ip).Platform, "platform is correct") assert.Equal(t, "Falkenberg", (*ip).DataCenter, "datacenter is correct") assert.Equal(t, "1.0.0.127-static.example.com.", (*ip).PTR, "ptr is correct") assert.Equal(t, 1.00, (*ip).Cost.Amount, "cost amount is correct") @@ -107,9 +107,9 @@ func TestIPService_Release(t *testing.T) { func TestIPs_SetPTR(t *testing.T) { c := &mockClient{body: `{ "response": { "details": { "ipaddress": "127.0.0.1", "netmask": "None", "broadcast": "None", "gateway": "None", "nameservers": ["127.255.255.1"], - "platform": "OpenVZ", "platforms": ["OpenVZ"], + "platform": "KVM", "platforms": ["KVM"], "cost": {"amount":1, "currency": "SEK", "timeperiod": "month"}, - "datacenter": "Falkenberg", "ipversion": 4, "serverid": "vz123456", "reserved": "yes", + "datacenter": "Falkenberg", "ipversion": 4, "serverid": "kvm123456", "reserved": "yes", "lockedtoaccount": "no", "ptr": "ptr.parker.example.com."} } }`} s := IPService{client: c} @@ -124,9 +124,9 @@ func TestIPs_SetPTR(t *testing.T) { func TestIPs_ResetPTR(t *testing.T) { c := &mockClient{body: `{ "response": { "details": { "ipaddress": "127.0.0.1", "netmask": "None", "broadcast": "None", "gateway": "None", "nameservers": ["127.255.255.1"], - "platform": "OpenVZ", "platforms": ["OpenVZ"], + "platform": "KVM", "platforms": ["KVM"], "cost": {"amount":1, "currency": "SEK", "timeperiod": "month"}, - "datacenter": "Falkenberg", "ipversion": 4, "serverid": "vz123456", "reserved": "yes", + "datacenter": "Falkenberg", "ipversion": 4, "serverid": "kvm123456", "reserved": "yes", "lockedtoaccount": "no", "ptr": "1-0-0-127-static.glesys.net."} } }`} s := IPService{client: c}