package main
import (
"fmt"
"log"
"github.com/softlayer/softlayer-go/services"
"github.com/softlayer/softlayer-go/session"
)
var remoteScriptURL = "http://example.com/scripts/preparevm"
func main() {
// Create a session
sess := session.New()
// Get the VirtualGuest service
service := services.GetVirtualGuestService(sess)
// Execute the script on VM with ID 12345678
err := service.Id(12345678).ExecuteRemoteScript(&remoteScriptURL)
if err != nil {
log.Fatal(err)
} else {
fmt.Println("Remote script sent for execution")
}
}
If this article contains any error, or leaves any of your questions unanswered, please help us out by
opening up a github issue.
Open an issue