1
// Copyright 2015 Canonical Ltd.
2
// Licensed under the AGPLv3, see LICENCE file for details.
7
"gopkg.in/juju/charm.v6-unstable"
8
"gopkg.in/juju/names.v2"
10
"github.com/juju/juju/apiserver/params"
13
// Snapshot is a snapshot of the remote state of the unit.
14
type Snapshot struct {
15
// Life is the lifecycle state of the unit.
18
// Relations contains the lifecycle states of
19
// each of the service's relations, keyed by
21
Relations map[int]RelationSnapshot
23
// Storage contains the lifecycle and attached
24
// states of each of the unit's storage attachments.
25
Storage map[names.StorageTag]StorageSnapshot
27
// CharmModifiedVersion is increased whenever the service's charm was
28
// changed in some way.
29
CharmModifiedVersion int
31
// CharmURL is the charm URL that the unit is
35
// ForceCharmUpgrade reports whether the unit
36
// should upgrade even in an error state.
37
ForceCharmUpgrade bool
39
// ResolvedMode reports the method of resolving
40
// hook execution errors.
41
ResolvedMode params.ResolvedMode
43
// RetryHookVersion increments each time a failed
44
// hook is meant to be retried if ResolvedMode is
45
// set to ResolvedNone.
48
// ConfigVersion is the last published version of
49
// the unit's config settings.
52
// Leader indicates whether or not the unit is the
56
// LeaderSettingsVersion is the last published
57
// version of the leader settings for the application.
58
LeaderSettingsVersion int
60
// UpdateStatusVersion increments each time an
61
// update-status hook is supposed to run.
62
UpdateStatusVersion int
64
// Actions is the list of pending actions to
65
// be peformed by this unit.
68
// Commands is the list of IDs of commands to be
69
// executed by this unit.
73
type RelationSnapshot struct {
75
Members map[string]int64
78
// StorageSnapshot has information relating to a storage
79
// instance belonging to a unit.
80
type StorageSnapshot struct {
81
Kind params.StorageKind