()
| 121 | } |
| 122 | |
| 123 | func (ins *Instance) populateExternalIP() { |
| 124 | gceInstance, err := ins.ComputeService.Instances.Get(ins.Project, ins.Zone, ins.Name).Do() |
| 125 | if err != nil { |
| 126 | return |
| 127 | } |
| 128 | |
| 129 | for i := range gceInstance.NetworkInterfaces { |
| 130 | ni := gceInstance.NetworkInterfaces[i] |
| 131 | for j := range ni.AccessConfigs { |
| 132 | ac := ni.AccessConfigs[j] |
| 133 | if len(ac.NatIP) > 0 { |
| 134 | ins.ExternalIP = ac.NatIP |
| 135 | return |
| 136 | } |
| 137 | } |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | // RunCommand runs a command on the GCE instance and returns the command result. |
| 142 | func (ins *Instance) RunCommand(cmd string) ssh.Result { |
no outgoing calls
no test coverage detected