summaryrefslogtreecommitdiff
path: root/digitalocean/droplet.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-12-30 23:30:14 -0600
committerJeff Carr <[email protected]>2023-12-30 23:30:14 -0600
commit44730e1b91d0aa9d412032aebe2fc0c8367ddf13 (patch)
treef0b92816ef7a672097183b776a9a78557a485f82 /digitalocean/droplet.go
parentbe03e85c2def1501b6b22572d8a1d140663194ab (diff)
digitalocean droplet power on & off work
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'digitalocean/droplet.go')
-rw-r--r--digitalocean/droplet.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/digitalocean/droplet.go b/digitalocean/droplet.go
index 45deb3d..6c0da08 100644
--- a/digitalocean/droplet.go
+++ b/digitalocean/droplet.go
@@ -20,6 +20,7 @@ func (d *DigitalOcean) NewDroplet(dd *godo.Droplet) *Droplet {
droplet := new(Droplet)
droplet.ready = false
droplet.poll = dd // the information polled from the digital ocean API
+ droplet.ID = dd.ID
if (d.dGrid == nil) {
d.dGrid = d.group.NewGrid("grid", 9, 1).Pad()
@@ -104,11 +105,13 @@ func (d *Droplet) Update(dpoll *godo.Droplet) {
func (d *Droplet) PowerOn() {
if ! d.Exists() {return}
log.Info("droplet.PowerOn() should do it here")
+ myDo.PowerOn(d.ID)
}
func (d *Droplet) PowerOff() {
if ! d.Exists() {return}
log.Info("droplet.PowerOff() here")
+ myDo.PowerOff(d.ID)
}
func (d *Droplet) Destroy() {