launchpad.net/~rogpeppe/juju-core/500-errgo-fix@v0.0.0-20140213181702-000000002356/provider/joyent/instance.go (about) 1 // Copyright 2013 Joyent Inc. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package joyent 5 6 import ( 7 "launchpad.net/juju-core/instance" 8 "launchpad.net/juju-core/provider/common" 9 ) 10 11 type environInstance struct { 12 id instance.Id 13 env *environ 14 } 15 16 var _ instance.Instance = (*environInstance)(nil) 17 18 func (inst *environInstance) Id() instance.Id { 19 return inst.id 20 } 21 22 func (inst *environInstance) Status() string { 23 _ = inst.env.getSnapshot() 24 return "unknown (not implemented)" 25 } 26 27 func (inst *environInstance) Refresh() error { 28 return nil 29 } 30 31 func (inst *environInstance) Addresses() ([]instance.Address, error) { 32 _ = inst.env.getSnapshot() 33 return nil, errNotImplemented 34 } 35 36 func (inst *environInstance) DNSName() (string, error) { 37 // This method is likely to be replaced entirely by Addresses() at some point, 38 // but remains necessary for now. It's probably smart to implement it in 39 // terms of Addresses above, to minimise churn when it's removed. 40 _ = inst.env.getSnapshot() 41 return "", errNotImplemented 42 } 43 44 func (inst *environInstance) WaitDNSName() (string, error) { 45 // This method is likely to be replaced entirely by Addresses() at some point, 46 // but remains necessary for now. Until it's finally removed, you can probably 47 // ignore this method; the common implementation should work. 48 return common.WaitDNSName(inst) 49 }