launchpad.net/~rogpeppe/juju-core/500-errgo-fix@v0.0.0-20140213181702-000000002356/provider/manual/instance.go (about) 1 // Copyright 2013 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package manual 5 6 import ( 7 "launchpad.net/juju-core/environs/manual" 8 "launchpad.net/juju-core/instance" 9 ) 10 11 type manualBootstrapInstance struct { 12 host string 13 } 14 15 func (manualBootstrapInstance) Id() instance.Id { 16 // The only way to bootrap is via manual bootstrap. 17 return manual.BootstrapInstanceId 18 } 19 20 func (manualBootstrapInstance) Status() string { 21 return "" 22 } 23 24 func (manualBootstrapInstance) Refresh() error { 25 return nil 26 } 27 28 func (inst manualBootstrapInstance) Addresses() (addresses []instance.Address, err error) { 29 return manual.HostAddresses(inst.host) 30 } 31 32 func (inst manualBootstrapInstance) DNSName() (string, error) { 33 return inst.host, nil 34 } 35 36 func (i manualBootstrapInstance) WaitDNSName() (string, error) { 37 return i.DNSName() 38 } 39 40 func (manualBootstrapInstance) OpenPorts(machineId string, ports []instance.Port) error { 41 return nil 42 } 43 44 func (manualBootstrapInstance) ClosePorts(machineId string, ports []instance.Port) error { 45 return nil 46 } 47 48 func (manualBootstrapInstance) Ports(machineId string) ([]instance.Port, error) { 49 return []instance.Port{}, nil 50 }