~juju-qa/ubuntu/xenial/juju/xenial-2.0-beta3

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/cmd/juju/status/formatted.go

  • Committer: Martin Packman
  • Date: 2016-03-30 19:31:08 UTC
  • mfrom: (1.1.41)
  • Revision ID: martin.packman@canonical.com-20160330193108-h9iz3ak334uk0z5r
Merge new upstream source 2.0~beta3

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
import (
7
7
        "encoding/json"
8
8
 
9
 
        "github.com/juju/juju/apiserver/params"
10
9
        "github.com/juju/juju/instance"
11
10
        "github.com/juju/juju/network"
 
11
        "github.com/juju/juju/status"
12
12
)
13
13
 
14
14
type formattedStatus struct {
33
33
}
34
34
 
35
35
type machineStatus struct {
36
 
        Err            error                    `json:"-" yaml:",omitempty"`
37
 
        AgentState     params.Status            `json:"agent-state,omitempty" yaml:"agent-state,omitempty"`
38
 
        AgentStateInfo string                   `json:"agent-state-info,omitempty" yaml:"agent-state-info,omitempty"`
39
 
        AgentVersion   string                   `json:"agent-version,omitempty" yaml:"agent-version,omitempty"`
40
 
        DNSName        string                   `json:"dns-name,omitempty" yaml:"dns-name,omitempty"`
41
 
        InstanceId     instance.Id              `json:"instance-id,omitempty" yaml:"instance-id,omitempty"`
42
 
        InstanceState  string                   `json:"instance-state,omitempty" yaml:"instance-state,omitempty"`
43
 
        Life           string                   `json:"life,omitempty" yaml:"life,omitempty"`
44
 
        Series         string                   `json:"series,omitempty" yaml:"series,omitempty"`
45
 
        Id             string                   `json:"-" yaml:"-"`
46
 
        Containers     map[string]machineStatus `json:"containers,omitempty" yaml:"containers,omitempty"`
47
 
        Hardware       string                   `json:"hardware,omitempty" yaml:"hardware,omitempty"`
48
 
        HAStatus       string                   `json:"controller-member-status,omitempty" yaml:"controller-member-status,omitempty"`
 
36
        Err           error                    `json:"-" yaml:",omitempty"`
 
37
        JujuStatus    statusInfoContents       `json:"juju-status,omitempty" yaml:"juju-status,omitempty"`
 
38
        DNSName       string                   `json:"dns-name,omitempty" yaml:"dns-name,omitempty"`
 
39
        InstanceId    instance.Id              `json:"instance-id,omitempty" yaml:"instance-id,omitempty"`
 
40
        MachineStatus statusInfoContents       `json:"machine-status,omitempty" yaml:"machine-status,omitempty"`
 
41
        Series        string                   `json:"series,omitempty" yaml:"series,omitempty"`
 
42
        Id            string                   `json:"-" yaml:"-"`
 
43
        Containers    map[string]machineStatus `json:"containers,omitempty" yaml:"containers,omitempty"`
 
44
        Hardware      string                   `json:"hardware,omitempty" yaml:"hardware,omitempty"`
 
45
        HAStatus      string                   `json:"controller-member-status,omitempty" yaml:"controller-member-status,omitempty"`
49
46
}
50
47
 
51
48
// A goyaml bug means we can't declare these types
103
100
type unitStatus struct {
104
101
        // New Juju Health Status fields.
105
102
        WorkloadStatusInfo statusInfoContents `json:"workload-status,omitempty" yaml:"workload-status"`
106
 
        AgentStatusInfo    statusInfoContents `json:"agent-status,omitempty" yaml:"agent-status"`
 
103
        JujuStatusInfo     statusInfoContents `json:"juju-status,omitempty" yaml:"juju-status"`
107
104
        MeterStatus        *meterStatus       `json:"meter-status,omitempty" yaml:"meter-status,omitempty"`
108
105
 
109
106
        Charm         string                `json:"upgrading-from,omitempty" yaml:"upgrading-from,omitempty"`
115
112
 
116
113
type statusInfoContents struct {
117
114
        Err     error         `json:"-" yaml:",omitempty"`
118
 
        Current params.Status `json:"current,omitempty" yaml:"current,omitempty"`
 
115
        Current status.Status `json:"current,omitempty" yaml:"current,omitempty"`
119
116
        Message string        `json:"message,omitempty" yaml:"message,omitempty"`
120
117
        Since   string        `json:"since,omitempty" yaml:"since,omitempty"`
121
118
        Version string        `json:"version,omitempty" yaml:"version,omitempty"`
 
119
        Life    string        `json:"life,omitempty" yaml:"life,omitempty"`
122
120
}
123
121
 
124
122
type statusInfoContentsNoMarshal statusInfoContents