Skip to main content
POST
/
servers
/
{server_id}
/
reinstall
Go (SDK)
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.Servers.Reinstall(ctx, "sv_Z8rodmJGq1jLB", operations.CreateServerReinstallServersRequestBody{
        Data: operations.CreateServerReinstallServersData{
            Type: operations.CreateServerReinstallServersTypeReinstalls,
            Attributes: &operations.CreateServerReinstallServersAttributes{
                OperatingSystem: operations.CreateServerReinstallServersOperatingSystemIpxe.ToPointer(),
                Hostname: latitudeshgosdk.Pointer("BRC1"),
                Ipxe: latitudeshgosdk.Pointer("https://some-host.com/image.ipxe"),
            },
        },
    })
    if err != nil {
        log.Fatal(err)
    }
    if res != nil {
        // handle response
    }
}
{}

Authorizations

Authorization
string
header
required

Path Parameters

server_id
string
required

Body

data
object
required

Response

201 - application/vnd.api+json

Created

The response is of type file.