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
|
// Copyright 2013 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package environs
import (
"launchpad.net/juju-core/constraints"
"launchpad.net/juju-core/environs/cloudinit"
"launchpad.net/juju-core/instance"
"launchpad.net/juju-core/tools"
)
// StartInstanceParams holds parameters for the
// InstanceBroker.StartInstace method.
type StartInstanceParams struct {
// Constraints is a set of constraints on
// the kind of instance to create.
Constraints constraints.Value
// Tools is a list of tools that may be used
// to start a Juju agent on the machine.
Tools tools.List
// MachineConfig describes the machine's configuration.
MachineConfig *cloudinit.MachineConfig
}
// TODO(wallyworld) - we want this in the environs/instance package but import loops
// stop that from being possible right now.
type InstanceBroker interface {
// StartInstance asks for a new instance to be created, associated with
// the provided config in machineConfig. The given config describes the juju
// state for the new instance to connect to. The config MachineNonce, which must be
// unique within an environment, is used by juju to protect against the
// consequences of multiple instances being started with the same machine
// id.
StartInstance(args StartInstanceParams) (instance.Instance, *instance.HardwareCharacteristics, error)
// StopInstances shuts down the given instances.
StopInstances([]instance.Instance) error
// AllInstances returns all instances currently known to the broker.
AllInstances() ([]instance.Instance, error)
}
|