~nskaggs/+junk/xenial-test

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/apiserver/params/leadership.go

  • Committer: Nicholas Skaggs
  • Date: 2016-10-24 20:56:05 UTC
  • Revision ID: nicholas.skaggs@canonical.com-20161024205605-z8lta0uvuhtxwzwl
Initi with beta15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright 2015 Canonical Ltd.
 
2
// Licensed under the AGPLv3, see LICENCE file for details.
 
3
 
 
4
package params
 
5
 
 
6
// ClaimLeadershipBulkParams is a collection of parameters for making
 
7
// a bulk leadership claim.
 
8
type ClaimLeadershipBulkParams struct {
 
9
 
 
10
        // Params are the parameters for making a bulk leadership claim.
 
11
        Params []ClaimLeadershipParams `json:"params"`
 
12
}
 
13
 
 
14
// ClaimLeadershipParams are the parameters needed for making a
 
15
// leadership claim.
 
16
type ClaimLeadershipParams struct {
 
17
 
 
18
        // ApplicationTag is the application for which you want to make a
 
19
        // leadership claim.
 
20
        ApplicationTag string `json:"application-tag"`
 
21
 
 
22
        // UnitTag is the unit which is making the leadership claim.
 
23
        UnitTag string `json:"unit-tag"`
 
24
 
 
25
        // DurationSeconds is the number of seconds for which the lease is required.
 
26
        DurationSeconds float64 `json:"duration"`
 
27
}
 
28
 
 
29
// ClaimLeadershipBulkResults is the collection of results from a bulk
 
30
// leadership claim.
 
31
type ClaimLeadershipBulkResults ErrorResults
 
32
 
 
33
// ReleaseLeadershipBulkParams is a collection of parameters needed to
 
34
// make a bulk release leadership call.
 
35
type ReleaseLeadershipBulkParams struct {
 
36
        Params []ReleaseLeadershipParams `json:"params"`
 
37
}
 
38
 
 
39
// ReleaseLeadershipParams are the parameters needed to release a
 
40
// leadership claim.
 
41
type ReleaseLeadershipParams struct {
 
42
 
 
43
        // ApplicationTag is the application for which you want to make a
 
44
        // leadership claim.
 
45
        ApplicationTag string `json:"application-tag"`
 
46
 
 
47
        // UnitTag is the unit which is making the leadership claim.
 
48
        UnitTag string `json:"unit-tag"`
 
49
}
 
50
 
 
51
// ReleaseLeadershipBulkResults is a type which contains results from
 
52
// a bulk leadership call.
 
53
type ReleaseLeadershipBulkResults ErrorResults
 
54
 
 
55
// GetLeadershipSettingsBulkResults is the collection of results from
 
56
// a bulk request for leadership settings.
 
57
type GetLeadershipSettingsBulkResults struct {
 
58
        Results []GetLeadershipSettingsResult `json:"results"`
 
59
}
 
60
 
 
61
// GetLeadershipSettingsResult is the results from requesting
 
62
// leadership settings.
 
63
type GetLeadershipSettingsResult struct {
 
64
        Settings Settings `json:"settings"`
 
65
        Error    *Error   `json:"error,omitempty"`
 
66
}
 
67
 
 
68
// MergeLeadershipSettingsBulkParams is a collection of parameters for
 
69
// making a bulk merge of leadership settings.
 
70
type MergeLeadershipSettingsBulkParams struct {
 
71
 
 
72
        // Params are the parameters for making a bulk leadership settings
 
73
        // merge.
 
74
        Params []MergeLeadershipSettingsParam `json:"params"`
 
75
}
 
76
 
 
77
// MergeLeadershipSettingsParam are the parameters needed for merging
 
78
// in leadership settings.
 
79
type MergeLeadershipSettingsParam struct {
 
80
        // ApplicationTag is the application for which you want to merge
 
81
        // leadership settings.
 
82
        ApplicationTag string `json:"application-tag"`
 
83
 
 
84
        // Settings are the Leadership settings you wish to merge in.
 
85
        Settings Settings `json:"settings"`
 
86
}