/
leadership.go
86 lines (67 loc) · 2.46 KB
/
leadership.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// Copyright 2015 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package params
// ClaimLeadershipBulkParams is a collection of parameters for making
// a bulk leadership claim.
type ClaimLeadershipBulkParams struct {
// Params are the parameters for making a bulk leadership claim.
Params []ClaimLeadershipParams
}
// ClaimLeadershipParams are the parameters needed for making a
// leadership claim.
type ClaimLeadershipParams struct {
// ServiceTag is the service for which you want to make a
// leadership claim.
ServiceTag string
// UnitTag is the unit which is making the leadership claim.
UnitTag string
// DurationSeconds is the number of seconds for which the lease is required.
DurationSeconds float64
}
// ClaimLeadershipBulkResults is the collection of results from a bulk
// leadership claim.
type ClaimLeadershipBulkResults ErrorResults
// ReleaseLeadershipBulkParams is a collection of parameters needed to
// make a bulk release leadership call.
type ReleaseLeadershipBulkParams struct {
Params []ReleaseLeadershipParams
}
// ReleaseLeadershipParams are the parameters needed to release a
// leadership claim.
type ReleaseLeadershipParams struct {
// ServiceTag is the service for which you want to make a
// leadership claim.
ServiceTag string
// UnitTag is the unit which is making the leadership claim.
UnitTag string
}
// ReleaseLeadershipBulkResults is a type which contains results from
// a bulk leadership call.
type ReleaseLeadershipBulkResults ErrorResults
// GetLeadershipSettingsBulkResults is the collection of results from
// a bulk request for leadership settings.
type GetLeadershipSettingsBulkResults struct {
Results []GetLeadershipSettingsResult
}
// GetLeadershipSettingsResult is the results from requesting
// leadership settings.
type GetLeadershipSettingsResult struct {
Settings Settings
Error *Error
}
// MergeLeadershipSettingsBulkParams is a collection of parameters for
// making a bulk merge of leadership settings.
type MergeLeadershipSettingsBulkParams struct {
// Params are the parameters for making a bulk leadership settings
// merge.
Params []MergeLeadershipSettingsParam
}
// MergeLeadershipSettingsParam are the parameters needed for merging
// in leadership settings.
type MergeLeadershipSettingsParam struct {
// ServiceTag is the service for which you want to merge
// leadership settings.
ServiceTag string
// Settings are the Leadership settings you wish to merge in.
Settings Settings
}