forked from juju/juju
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shim.go
38 lines (32 loc) · 1.23 KB
/
shim.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
// Copyright 2018 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package upgradeseries
import (
"github.com/juju/names/v4"
"github.com/DavinZhang/juju/api/base"
"github.com/DavinZhang/juju/api/upgradeseries"
"github.com/DavinZhang/juju/core/model"
"github.com/DavinZhang/juju/core/watcher"
)
// Facade exposes the API surface required by the upgrade-series worker.
type Facade interface {
// Getters
WatchUpgradeSeriesNotifications() (watcher.NotifyWatcher, error)
MachineStatus() (model.UpgradeSeriesStatus, error)
UnitsPrepared() ([]names.UnitTag, error)
UnitsCompleted() ([]names.UnitTag, error)
CurrentSeries() (string, error)
TargetSeries() (string, error)
// Setters
StartUnitCompletion(reason string) error
SetMachineStatus(status model.UpgradeSeriesStatus, reason string) error
FinishUpgradeSeries(string) error
PinMachineApplications() (map[string]error, error)
UnpinMachineApplications() (map[string]error, error)
SetInstanceStatus(model.UpgradeSeriesStatus, string) error
}
// NewFacade creates a new upgrade-series client and returns its
// reference as the facade indirection above.
func NewFacade(apiCaller base.APICaller, tag names.Tag) Facade {
return upgradeseries.NewClient(apiCaller, tag)
}