create works from a filename

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-11-16 05:22:41 -06:00
parent 6944de6d85
commit f45dacfcaf
3 changed files with 8 additions and 5 deletions

View File

@ -25,14 +25,17 @@ func createFilename(dir string, filename string) error {
hostname := strings.TrimSuffix(filename, filetype)
log.Info("hostname ==", hostname)
var newDroplet *pb.Droplet
newDroplet = new(pb.Droplet)
newDroplet.Hostname = hostname
newDroplet := pb.NewDefaultDroplet(hostname)
newDisk := new(pb.Disk)
newDisk.Filename = filename
newDisk.Filepath = dir
newDroplet.Disks = append(newDroplet.Disks, newDisk)
var eth *pb.Network
eth = new(pb.Network)
eth.Name = "worldbr"
newDroplet.Networks = append(newDroplet.Networks, eth)
url := urlbase + "/create"
// body, err := postDropletJSON(url, newDroplet)