github.com/mattyw/juju@v0.0.0-20140610034352-732aecd63861/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  	"github.com/juju/juju/environs/manual"
     8  	"github.com/juju/juju/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  	addr, err := manual.HostAddress(inst.host)
    30  	if err != nil {
    31  		return nil, err
    32  	}
    33  	return []instance.Address{addr}, nil
    34  }
    35  
    36  func (manualBootstrapInstance) OpenPorts(machineId string, ports []instance.Port) error {
    37  	return nil
    38  }
    39  
    40  func (manualBootstrapInstance) ClosePorts(machineId string, ports []instance.Port) error {
    41  	return nil
    42  }
    43  
    44  func (manualBootstrapInstance) Ports(machineId string) ([]instance.Port, error) {
    45  	return []instance.Port{}, nil
    46  }