forked from juju/juju
/
instance.go
51 lines (41 loc) · 1.21 KB
/
instance.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright 2013 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package manual
import (
"github.com/juju/juju/environs/manual"
"github.com/juju/juju/instance"
"github.com/juju/juju/network"
"github.com/juju/juju/status"
)
type manualBootstrapInstance struct {
host string
}
func (manualBootstrapInstance) Id() instance.Id {
return BootstrapInstanceId
}
func (manualBootstrapInstance) Status() instance.InstanceStatus {
// We asume that if we are deploying in manual provider the
// underlying machine is clearly running.
return instance.InstanceStatus{
Status: status.Running,
}
}
func (manualBootstrapInstance) Refresh() error {
return nil
}
func (inst manualBootstrapInstance) Addresses() (addresses []network.Address, err error) {
addr, err := manual.HostAddress(inst.host)
if err != nil {
return nil, err
}
return []network.Address{addr}, nil
}
func (manualBootstrapInstance) OpenPorts(machineId string, rules []network.IngressRule) error {
return nil
}
func (manualBootstrapInstance) ClosePorts(machineId string, rules []network.IngressRule) error {
return nil
}
func (manualBootstrapInstance) IngressRules(machineId string) ([]network.IngressRule, error) {
return nil, nil
}