Leaseweb Dedicated & Virtual Servers V2 JSON-RPC API in Golang
go get -u github.com/gadost/go-lwapi@latest
package main
import (
"github.com/gadost/go-lwapi"
)
func main() {
// Dedicated Server AAPI
api := lwapi.New("testtoken").DedicatedServers()
resp, err := api.ServerReferenceUpdate(12345, &lwapi.Reference{Reference: "test-server"})
...
// Virtual Server API
api := lwapi.New("testtoken").VirtualServers()
resp, err := api.VirtualServer(12345)
...
}
api := lwapi.New("testtoken").DedicatedServers()
q := make(map[string]interface{})
q["limit"] = 20
q["privateNetworkEnabled"] = "true"
q["ip"] = "127.0.0.1"
resp, err := api.Servers(q)
...
to := FormatISO8601(time.Now().Add(60*time.Day))
returns time in ISO-8601 format