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.StartOutOfBandConnection(ctx, "sv_8NkvdyGKDeLpx", operations.CreateServerOutOfBandServersRequestBody{
Data: operations.CreateServerOutOfBandServersData{
Type: operations.CreateServerOutOfBandServersTypeOutOfBand,
Attributes: &operations.CreateServerOutOfBandServersAttributes{
SSHKeyID: latitudeshgosdk.Pointer("ssh_3YjJOLMydvZ87"),
},
},
})
if err != nil {
log.Fatal(err)
}
if res.OutOfBandConnection != nil {
// handle response
}
}{
"data": {
"id": "obc_mw49QDB5qagKb",
"type": "out_of_band",
"attributes": {
"ssh_key": {
"id": "ssh_3YjJOLMydvZ87",
"description": "wisozk-gislason.example",
"fingerprint": "14:e2:8e:b3:9e:f5:08:31:b6:c7:43:6d:f5:1e:6d:b2"
},
"created_at": "2026-01-14T15:56:58+00:00",
"username": "server-1",
"credentials": {
"user": "donn",
"password": "398ig362ci"
},
"port": "2222",
"access_ip": "189.1.2.0",
"server_id": "sv_8NkvdyGKDeLpx",
"status": "connected"
}
},
"meta": {}
}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.StartOutOfBandConnection(ctx, "sv_8NkvdyGKDeLpx", operations.CreateServerOutOfBandServersRequestBody{
Data: operations.CreateServerOutOfBandServersData{
Type: operations.CreateServerOutOfBandServersTypeOutOfBand,
Attributes: &operations.CreateServerOutOfBandServersAttributes{
SSHKeyID: latitudeshgosdk.Pointer("ssh_3YjJOLMydvZ87"),
},
},
})
if err != nil {
log.Fatal(err)
}
if res.OutOfBandConnection != nil {
// handle response
}
}{
"data": {
"id": "obc_mw49QDB5qagKb",
"type": "out_of_band",
"attributes": {
"ssh_key": {
"id": "ssh_3YjJOLMydvZ87",
"description": "wisozk-gislason.example",
"fingerprint": "14:e2:8e:b3:9e:f5:08:31:b6:c7:43:6d:f5:1e:6d:b2"
},
"created_at": "2026-01-14T15:56:58+00:00",
"username": "server-1",
"credentials": {
"user": "donn",
"password": "398ig362ci"
},
"port": "2222",
"access_ip": "189.1.2.0",
"server_id": "sv_8NkvdyGKDeLpx",
"status": "connected"
}
},
"meta": {}
}Was this page helpful?