github.com/altoros/juju-vmware@v0.0.0-20150312064031-f19ae857ccca/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  	"github.com/juju/juju/network"
    10  )
    11  
    12  type manualBootstrapInstance struct {
    13  	host string
    14  }
    15  
    16  func (manualBootstrapInstance) Id() instance.Id {
    17  	return 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 []network.Address, err error) {
    29  	addr, err := manual.HostAddress(inst.host)
    30  	if err != nil {
    31  		return nil, err
    32  	}
    33  	return []network.Address{addr}, nil
    34  }
    35  
    36  func (manualBootstrapInstance) OpenPorts(machineId string, ports []network.PortRange) error {
    37  	return nil
    38  }
    39  
    40  func (manualBootstrapInstance) ClosePorts(machineId string, ports []network.PortRange) error {
    41  	return nil
    42  }
    43  
    44  func (manualBootstrapInstance) Ports(machineId string) ([]network.PortRange, error) {
    45  	return nil, nil
    46  }