1
// Copyright 2015 Canonical Ltd.
2
// Licensed under the AGPLv3, see LICENCE file for details.
6
// CharmsList stores parameters for a charms.List call
7
type CharmsList struct {
8
Names []string `json:"names"`
11
// CharmsListResult stores result from a charms.List call
12
type CharmsListResult struct {
13
CharmURLs []string `json:"charm-urls"`
16
// IsMeteredResult stores result from a charms.IsMetered call
17
type IsMeteredResult struct {
18
Metered bool `json:"metered"`
21
// CharmOption mirrors charm.Option
22
type CharmOption struct {
23
Type string `json:"type"`
24
Description string `json:"description,omitempty"`
25
Default interface{} `json:"default,omitempty"`
28
// CharmRelation mirrors charm.Relation.
29
type CharmRelation struct {
30
Name string `json:"name"`
31
Role string `json:"role"`
32
Interface string `json:"interface"`
33
Optional bool `json:"optional"`
34
Limit int `json:"limit"`
35
Scope string `json:"scope"`
38
// CharmStorage mirrors charm.Storage.
39
type CharmStorage struct {
40
Name string `json:"name"`
41
Description string `json:"description"`
42
Type string `json:"type"`
43
Shared bool `json:"shared"`
44
ReadOnly bool `json:"read-only"`
45
CountMin int `json:"count-min"`
46
CountMax int `json:"count-max"`
47
MinimumSize uint64 `json:"minimum-size"`
48
Location string `json:"location,omitempty"`
49
Properties []string `json:"properties,omitempty"`
52
// CharmPayloadClass mirrors charm.PayloadClass.
53
type CharmPayloadClass struct {
54
Name string `json:"name"`
55
Type string `json:"type"`
58
// CharmResourceMeta mirrors charm.ResourceMeta.
59
type CharmResourceMeta struct {
60
Name string `json:"name"`
61
Type string `json:"type"`
62
Path string `json:"path"`
63
Description string `json:"description"`
66
// CharmMeta mirrors charm.Meta.
67
type CharmMeta struct {
68
Name string `json:"name"`
69
Summary string `json:"summary"`
70
Description string `json:"description"`
71
Subordinate bool `json:"subordinate"`
72
Provides map[string]CharmRelation `json:"provides,omitempty"`
73
Requires map[string]CharmRelation `json:"requires,omitempty"`
74
Peers map[string]CharmRelation `json:"peers,omitempty"`
75
ExtraBindings map[string]string `json:"extra-bindings,omitempty"`
76
Categories []string `json:"categories,omitempty"`
77
Tags []string `json:"tags,omitempty"`
78
Series []string `json:"series,omitempty"`
79
Storage map[string]CharmStorage `json:"storage,omitempty"`
80
PayloadClasses map[string]CharmPayloadClass `json:"payload-classes,omitempty"`
81
Resources map[string]CharmResourceMeta `json:"resources,omitempty"`
82
Terms []string `json:"terms,omitempty"`
83
MinJujuVersion string `json:"min-juju-version,omitempty"`
86
// CharmInfo holds all the charm data that the client needs.
87
// To be honest, it probably returns way more than what is actually needed.
88
type CharmInfo struct {
89
Revision int `json:"revision"`
90
URL string `json:"url"`
91
Config map[string]CharmOption `json:"config"`
92
Meta *CharmMeta `json:"meta,omitempty"`
93
Actions *CharmActions `json:"actions,omitempty"`
94
Metrics *CharmMetrics `json:"metrics,omitempty"`
97
// CharmActions mirrors charm.Actions.
98
type CharmActions struct {
99
ActionSpecs map[string]CharmActionSpec `json:"specs,omitempty"`
102
// CharmActionSpec mirrors charm.ActionSpec.
103
type CharmActionSpec struct {
104
Description string `json:"description"`
105
Params map[string]interface{} `json:"params"`
108
// CharmMetric mirrors charm.Metric.
109
type CharmMetric struct {
110
Type string `json:"type"`
111
Description string `json:"description"`
114
// CharmMetrics mirrors charm.Metrics.
115
type CharmMetrics struct {
116
Metrics map[string]CharmMetric `json:"metrics"`