mirror of
https://github.com/getcompanion-ai/computer-host.git
synced 2026-04-15 03:00:42 +00:00
feat: firecracker mmds identity
This commit is contained in:
parent
500354cd9b
commit
3eb610b703
23 changed files with 1813 additions and 263 deletions
|
|
@ -17,6 +17,7 @@ type Machine struct {
|
|||
}
|
||||
|
||||
type GuestConfig struct {
|
||||
Hostname string `json:"hostname,omitempty"`
|
||||
AuthorizedKeys []string `json:"authorized_keys,omitempty"`
|
||||
TrustedUserCAKeys []string `json:"trusted_user_ca_keys,omitempty"`
|
||||
LoginWebhook *GuestLoginWebhook `json:"login_webhook,omitempty"`
|
||||
|
|
|
|||
|
|
@ -4,10 +4,31 @@ import "time"
|
|||
|
||||
type SnapshotID string
|
||||
|
||||
type SnapshotArtifactKind string
|
||||
|
||||
const (
|
||||
SnapshotArtifactKindMemory SnapshotArtifactKind = "memory"
|
||||
SnapshotArtifactKindVMState SnapshotArtifactKind = "vmstate"
|
||||
SnapshotArtifactKindDisk SnapshotArtifactKind = "disk"
|
||||
SnapshotArtifactKindManifest SnapshotArtifactKind = "manifest"
|
||||
)
|
||||
|
||||
type Snapshot struct {
|
||||
ID SnapshotID `json:"id"`
|
||||
MachineID MachineID `json:"machine_id"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
ID SnapshotID `json:"id"`
|
||||
MachineID MachineID `json:"machine_id"`
|
||||
SourceRuntimeHost string `json:"source_runtime_host,omitempty"`
|
||||
SourceTapDevice string `json:"source_tap_device,omitempty"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
|
||||
type SnapshotArtifact struct {
|
||||
ID string `json:"id"`
|
||||
Kind SnapshotArtifactKind `json:"kind"`
|
||||
Name string `json:"name"`
|
||||
SizeBytes int64 `json:"size_bytes"`
|
||||
SHA256Hex string `json:"sha256_hex,omitempty"`
|
||||
ObjectKey string `json:"object_key,omitempty"`
|
||||
DownloadURL string `json:"download_url,omitempty"`
|
||||
}
|
||||
|
||||
type CreateSnapshotRequest struct {
|
||||
|
|
@ -15,7 +36,8 @@ type CreateSnapshotRequest struct {
|
|||
}
|
||||
|
||||
type CreateSnapshotResponse struct {
|
||||
Snapshot Snapshot `json:"snapshot"`
|
||||
Snapshot Snapshot `json:"snapshot"`
|
||||
Artifacts []SnapshotArtifact `json:"artifacts,omitempty"`
|
||||
}
|
||||
|
||||
type GetSnapshotResponse struct {
|
||||
|
|
@ -26,8 +48,52 @@ type ListSnapshotsResponse struct {
|
|||
Snapshots []Snapshot `json:"snapshots"`
|
||||
}
|
||||
|
||||
type SnapshotUploadPart struct {
|
||||
PartNumber int32 `json:"part_number"`
|
||||
OffsetBytes int64 `json:"offset_bytes"`
|
||||
SizeBytes int64 `json:"size_bytes"`
|
||||
UploadURL string `json:"upload_url"`
|
||||
}
|
||||
|
||||
type SnapshotArtifactUploadSession struct {
|
||||
ArtifactID string `json:"artifact_id"`
|
||||
ObjectKey string `json:"object_key"`
|
||||
UploadID string `json:"upload_id"`
|
||||
Parts []SnapshotUploadPart `json:"parts"`
|
||||
}
|
||||
|
||||
type UploadSnapshotRequest struct {
|
||||
Artifacts []SnapshotArtifactUploadSession `json:"artifacts"`
|
||||
}
|
||||
|
||||
type UploadedSnapshotPart struct {
|
||||
PartNumber int32 `json:"part_number"`
|
||||
ETag string `json:"etag"`
|
||||
}
|
||||
|
||||
type UploadedSnapshotArtifact struct {
|
||||
ArtifactID string `json:"artifact_id"`
|
||||
CompletedParts []UploadedSnapshotPart `json:"completed_parts"`
|
||||
}
|
||||
|
||||
type UploadSnapshotResponse struct {
|
||||
Artifacts []UploadedSnapshotArtifact `json:"artifacts"`
|
||||
}
|
||||
|
||||
type RestoreSnapshotRequest struct {
|
||||
MachineID MachineID `json:"machine_id"`
|
||||
MachineID MachineID `json:"machine_id"`
|
||||
Artifact ArtifactRef `json:"artifact"`
|
||||
Snapshot DurableSnapshotSpec `json:"snapshot"`
|
||||
GuestConfig *GuestConfig `json:"guest_config,omitempty"`
|
||||
}
|
||||
|
||||
type DurableSnapshotSpec struct {
|
||||
SnapshotID SnapshotID `json:"snapshot_id"`
|
||||
MachineID MachineID `json:"machine_id"`
|
||||
ImageID string `json:"image_id"`
|
||||
SourceRuntimeHost string `json:"source_runtime_host,omitempty"`
|
||||
SourceTapDevice string `json:"source_tap_device,omitempty"`
|
||||
Artifacts []SnapshotArtifact `json:"artifacts"`
|
||||
}
|
||||
|
||||
type RestoreSnapshotResponse struct {
|
||||
|
|
|
|||
|
|
@ -9,9 +9,10 @@ type VolumeID string
|
|||
type VolumeKind string
|
||||
|
||||
const (
|
||||
MachinePhaseRunning MachinePhase = "running"
|
||||
MachinePhaseStopped MachinePhase = "stopped"
|
||||
MachinePhaseFailed MachinePhase = "failed"
|
||||
MachinePhaseStarting MachinePhase = "starting"
|
||||
MachinePhaseRunning MachinePhase = "running"
|
||||
MachinePhaseStopped MachinePhase = "stopped"
|
||||
MachinePhaseFailed MachinePhase = "failed"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue