Skip to content

Commit

Permalink
Replace OpenVZ references with KVM in doc_test and ips_test
Browse files Browse the repository at this point in the history
  • Loading branch information
norrland committed Apr 5, 2024
1 parent 7ec48e2 commit e767ad4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions doc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func ExampleIPService_Available() {

ips, _ := client.IPs.Available(context.Background(), glesys.AvailableIPsParams{
DataCenter: "Falkenberg",
Platform: "OpenVZ",
Platform: "KVM",
Version: 4,
})

Expand Down Expand Up @@ -455,23 +455,23 @@ 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
})
}

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)
}

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",
Expand All @@ -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
})
}
Expand Down
14 changes: 7 additions & 7 deletions ips_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand All @@ -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")
Expand Down Expand Up @@ -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}

Expand All @@ -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}

Expand Down

0 comments on commit e767ad4

Please sign in to comment.