package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"github.com/latitudesh/latitudesh-go-sdk/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.VirtualMachines.CreateVirtualMachineAction(ctx, "vm_VLMmAD8EOwop2", operations.CreateVirtualMachineActionVirtualMachinesRequestBody{
ID: "vm_VLMmAD8EOwop2",
Type: operations.CreateVirtualMachineActionVirtualMachinesTypeVirtualMachines,
Attributes: operations.CreateVirtualMachineActionVirtualMachinesAttributes{
Action: operations.CreateVirtualMachineActionVirtualMachinesActionReboot,
},
})
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}