Create a snapshot for an instance
client.Instances.Snapshots.New(ctx, id, body) (*Snapshot, error)
/instances/{id}/snapshots
Create a snapshot for an instance
Parameters
id string
Returns
Create a snapshot for an instance
package main
import (
"context"
"fmt"
"github.com/kernel/hypeman-go"
"github.com/kernel/hypeman-go/option"
)
func main() {
client := hypeman.NewClient(
option.WithAPIKey("My API Key"),
)
snapshot, err := client.Instances.Snapshots.New(
context.TODO(),
"id",
hypeman.InstanceSnapshotNewParams{
Kind: hypeman.SnapshotKindStandby,
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", snapshot.ID)
}
{
"id": "q7z1w7l2af4l8y7q1h7g2m3s",
"created_at": "2026-03-06T13:56:11Z",
"kind": "Standby",
"size_bytes": 104857600,
"source_hypervisor": "cloud-hypervisor",
"source_instance_id": "qilviffnqzck2jrim1x6s2b1",
"source_instance_name": "nginx1",
"name": "baseline-standby",
"tags": {
"team": "backend",
"env": "staging"
}
}
Returns Examples
{
"id": "q7z1w7l2af4l8y7q1h7g2m3s",
"created_at": "2026-03-06T13:56:11Z",
"kind": "Standby",
"size_bytes": 104857600,
"source_hypervisor": "cloud-hypervisor",
"source_instance_id": "qilviffnqzck2jrim1x6s2b1",
"source_instance_name": "nginx1",
"name": "baseline-standby",
"tags": {
"team": "backend",
"env": "staging"
}
}