mirror of
https://github.com/getcompanion-ai/computer-host.git
synced 2026-04-15 09:01:12 +00:00
feat: deepen machine and storage contracts
This commit is contained in:
parent
6f0f0643fe
commit
04575d111c
5 changed files with 77 additions and 27 deletions
|
|
@ -6,22 +6,40 @@ import (
|
|||
contracthost "github.com/getcompanion-ai/computer-host/contract"
|
||||
)
|
||||
|
||||
type MachineRecord struct {
|
||||
ID contracthost.MachineID
|
||||
Phase contracthost.MachinePhase
|
||||
RuntimeHost string
|
||||
Error string
|
||||
CreatedAt time.Time
|
||||
StartedAt *time.Time
|
||||
}
|
||||
|
||||
type StoragePool string
|
||||
|
||||
type VolumeRecord struct {
|
||||
ID contracthost.VolumeID
|
||||
MachineID contracthost.MachineID
|
||||
Kind contracthost.VolumeKind
|
||||
Pool StoragePool
|
||||
Path string
|
||||
CreatedAt time.Time
|
||||
const (
|
||||
StoragePoolArtifacts StoragePool = "artifacts"
|
||||
StoragePoolMachineDisks StoragePool = "machine-disks"
|
||||
StoragePoolState StoragePool = "state"
|
||||
StoragePoolUserVolumes StoragePool = "user-volumes"
|
||||
)
|
||||
|
||||
type ArtifactRecord struct {
|
||||
Ref contracthost.ArtifactRef
|
||||
KernelImagePath string
|
||||
RootFSPath string
|
||||
CreatedAt time.Time
|
||||
}
|
||||
|
||||
type MachineRecord struct {
|
||||
ID contracthost.MachineID
|
||||
Artifact contracthost.ArtifactRef
|
||||
SystemVolumeID contracthost.VolumeID
|
||||
UserVolumeIDs []contracthost.VolumeID
|
||||
Phase contracthost.MachinePhase
|
||||
RuntimeHost string
|
||||
Error string
|
||||
CreatedAt time.Time
|
||||
StartedAt *time.Time
|
||||
}
|
||||
|
||||
type VolumeRecord struct {
|
||||
ID contracthost.VolumeID
|
||||
Kind contracthost.VolumeKind
|
||||
AttachedMachineID *contracthost.MachineID
|
||||
SourceArtifact *contracthost.ArtifactRef
|
||||
Pool StoragePool
|
||||
Path string
|
||||
CreatedAt time.Time
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue