38 lines
646 B
Go
38 lines
646 B
Go
|
package service
|
||
|
|
||
|
import (
|
||
|
"awesome_cli/internal/entity"
|
||
|
"github.com/gofrs/uuid"
|
||
|
)
|
||
|
|
||
|
type VM struct {
|
||
|
}
|
||
|
|
||
|
func VMService() *VM {
|
||
|
return &VM{}
|
||
|
}
|
||
|
|
||
|
func (vm *VM) List() []entity.VirtualMachineOutput {
|
||
|
u, _ := uuid.NewV4()
|
||
|
return []entity.VirtualMachineOutput{
|
||
|
{
|
||
|
UUID: u.String(),
|
||
|
Status: 1,
|
||
|
Name: "Awesome VM",
|
||
|
Autostart: false,
|
||
|
CPU: 8,
|
||
|
DatastoreName: "datastore",
|
||
|
Memory: 8,
|
||
|
},
|
||
|
{
|
||
|
UUID: u.String(),
|
||
|
Status: 2,
|
||
|
Name: "Awesome VM2",
|
||
|
Autostart: true,
|
||
|
CPU: 18,
|
||
|
DatastoreName: "datastore2",
|
||
|
Memory: 8,
|
||
|
},
|
||
|
}
|
||
|
}
|