Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace OpenVZ references with KVM in doc_test and ips_test #108

Merged
merged 1 commit into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading