-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconstants.go
61 lines (50 loc) · 1.46 KB
/
constants.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
52
53
54
55
56
57
58
59
60
61
// Copyright 2013 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package juju
// Life describes the lifecycle state of an entity ("alive", "dying"
// or "dead").
type Life string
const (
Alive Life = "alive"
Dying Life = "dying"
Dead Life = "dead"
)
// Status represents the status of an entity.
// It could be a unit, machine or its agent.
// TODO(dfc) once state does not depend on apisever/params
// this type will be rewritten to be
// type Status state.Status
type Status string
const (
// The entity is not yet participating in the environment.
StatusPending Status = "pending"
// The unit has performed initial setup and is adapting itself to
// the environment. Not applicable to machines.
StatusInstalled Status = "installed"
// The entity is actively participating in the environment.
StatusStarted Status = "started"
// The entity's agent will perform no further action, other than
// to set the unit to Dead at a suitable moment.
StatusStopped Status = "stopped"
// The entity requires human intervention in order to operate
// correctly.
StatusError Status = "error"
// The entity ought to be signalling activity, but it cannot be
// detected.
StatusDown Status = "down"
)
// Valid returns true if status has a known value.
func (status Status) Valid() bool {
switch status {
case
StatusPending,
StatusInstalled,
StatusStarted,
StatusStopped,
StatusError,
StatusDown:
default:
return false
}
return true
}