create works from a filename
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
6944de6d85
commit
f45dacfcaf
|
@ -25,14 +25,17 @@ func createFilename(dir string, filename string) error {
|
||||||
hostname := strings.TrimSuffix(filename, filetype)
|
hostname := strings.TrimSuffix(filename, filetype)
|
||||||
log.Info("hostname ==", hostname)
|
log.Info("hostname ==", hostname)
|
||||||
|
|
||||||
var newDroplet *pb.Droplet
|
newDroplet := pb.NewDefaultDroplet(hostname)
|
||||||
newDroplet = new(pb.Droplet)
|
|
||||||
newDroplet.Hostname = hostname
|
|
||||||
newDisk := new(pb.Disk)
|
newDisk := new(pb.Disk)
|
||||||
newDisk.Filename = filename
|
newDisk.Filename = filename
|
||||||
newDisk.Filepath = dir
|
newDisk.Filepath = dir
|
||||||
newDroplet.Disks = append(newDroplet.Disks, newDisk)
|
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"
|
url := urlbase + "/create"
|
||||||
|
|
||||||
// body, err := postDropletJSON(url, newDroplet)
|
// body, err := postDropletJSON(url, newDroplet)
|
||||||
|
|
Loading…
Reference in New Issue