add more codes

This commit is contained in:
2025-11-23 22:37:27 +07:00
parent b506a64ed1
commit 4fcd71ca05
10 changed files with 448 additions and 52 deletions

View File

@@ -10,27 +10,28 @@ type Manager interface {
}
type Spec struct {
ID string
Name string
Template string
RootfsPool string
RootfsSizeG int
NICs []NICSpec
Limits Limits
Unprivileged bool
ID string `json:"id" yaml:"id"`
Name string `json:"name" yaml:"name"`
Template string `json:"template" yaml:"template"`
RootfsPool string `json:"rootfs_pool" yaml:"rootfs_pool"`
RootfsSizeG int `json:"rootfs_size_g" yaml:"rootfs_size_g"`
RootfsPath string `json:"rootfs_path" yaml:"rootfs_path"`
NICs []NICSpec `json:"nics" yaml:"nics"`
Limits Limits `json:"limits" yaml:"limits"`
Unprivileged bool `json:"unprivileged" yaml:"unprivileged"`
}
type NICSpec struct {
Bridge string
VLAN int
HWAddr string
MTU int
Name string
Bridge string `json:"bridge" yaml:"bridge"`
VLAN int `json:"vlan" yaml:"vlan"`
HWAddr string `json:"hwaddr" yaml:"hwaddr"`
MTU int `json:"mtu" yaml:"mtu"`
Name string `json:"name" yaml:"name"`
}
type Limits struct {
CPU int
MemoryMB int
CPU int `json:"cpus" yaml:"cpus"`
MemoryMB int `json:"memory_mb" yaml:"memory_mb"`
}
type Container struct {