Merge lp://staging/~menno.smits/juju-core/1194481-relation_name_in_status.0 into lp://staging/~go-bot/juju-core/trunk
Status: | Work in progress |
---|---|
Proposed branch: | lp://staging/~menno.smits/juju-core/1194481-relation_name_in_status.0 |
Merge into: | lp://staging/~go-bot/juju-core/trunk |
Diff against target: |
266 lines (+68/-18) 4 files modified
state/api/client.go (+8/-0) state/apiserver/client/api_test.go (+26/-7) state/apiserver/client/perm_test.go (+2/-2) state/apiserver/client/status.go (+32/-9) |
To merge this branch: | bzr merge lp://staging/~menno.smits/juju-core/1194481-relation_name_in_status.0 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+219973@code.staging.launchpad.net |
Description of the change
state/api{,server}: more info from FullStatus API
Machines and units now have a StatusData map in the FullStatus API
response which holds extra status information that a client may choose
to use when displaying status. This was already being created but
wasn't through the client API.
The FullStatus response now also includes a map of relation id to
relation data (currently just the relation key). This can be used to
present a user friendly relation name to users (e.g. the StatusData
dict contains the relation id when a relation hook fails)
These new bits of data will be used to display the relation name in
the "juju status" output when a relation hook fails.
The client API test scenario has been extended to include a case of a
unit with an error with extra status data included.
Unmerged revisions
- 2735. By Menno Finlay-Smits
-
Return relation map in status API response
This can be helpful for clients wishing to display the relation name
when, for example, relation hooks fail (coming soon). - 2734. By Menno Finlay-Smits
-
Merged from trunk
- 2733. By Menno Finlay-Smits
-
Pass Machine and Unit StatusData through the client API
This is generally useful but is also specifically required to support
reporting of the affected relation when a hook fails.The client API test scenario has been extended to include a case of a
unit with an error with status data included.
Reviewers: mp+219973_ code.launchpad. net,
Message:
Please take a look.
Description:
state/api{,server}: StatusData through client API
Machines and units have a StatusData map which hold extra status
information that a client may use when displaying status but this
wasn't being passed through the client API.
The change is generally useful but is specifically required to support
reporting of the affected relation when a hook fails (coming soon).
The client API test scenario has been extended to include a case of a
unit with an error with status data included.
https:/ /code.launchpad .net/~menno. smits/juju- core/1194481- relation_ name_in_ status. 0/+merge/ 219973
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/93480044/
Affected files (+33, -12 lines): /client/ api_test. go /client/ perm_test. go /client/ status. go
A [revision details]
M state/api/client.go
M state/apiserver
M state/apiserver
M state/apiserver
Index: [revision details] 20140515103108- 2gr30jafikdtija k
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-
+New revision: <email address hidden>
Index: state/api/client.go api/client. go'
=== modified file 'state/
--- state/api/client.go 2014-05-13 04:30:48 +0000
+++ state/api/client.go 2014-05-16 04:14:32 +0000
@@ -50,6 +50,7 @@
Err error
AgentState params.Status
AgentStateInfo string
+ AgentStateData params.StatusData
AgentVersion string
DNSName string
InstanceId instance.Id
@@ -82,6 +83,7 @@
Err error
AgentState params.Status
AgentStateInfo string
+ AgentStateData params.StatusData
AgentVersion string
Life string
Machine string
Index: state/apiserver /client/ api_test. go apiserver/ client/ api_test. go' /client/ api_test. go 2014-05-13 04:30:48 +0000 /client/ api_test. go 2014-05-16 04:14:32 +0000 Id("i-machine- 0"), Info: "(started)", StatusData{ }, api.MachineStat us{}, MachineJob{ params. JobManageEnviro n}, Id("i-machine- 1"), Info: "(started)", StatusData{ }, api.MachineStat us{}, MachineJob{ params. JobHostUnits} , Id("i-machine- 2"), Info: "(started)", StatusData{ }, api.MachineStat us{}, MachineJob{ params. JobHostUnits} , api.UnitStatus{ wordpress/ 0": api.UnitSta...
=== modified file 'state/
--- state/apiserver
+++ state/apiserver
@@ -152,6 +152,7 @@
InstanceId: instance.
AgentState: "down",
AgentState
+ AgentStateData: params.
Series: "quantal",
Containers: map[string]
Jobs: []params.
@@ -163,6 +164,7 @@
InstanceId: instance.
AgentState: "down",
AgentState
+ AgentStateData: params.
Series: "quantal",
Containers: map[string]
Jobs: []params.
@@ -174,6 +176,7 @@
InstanceId: instance.
AgentState: "down",
AgentState
+ AgentStateData: params.
Series: "quantal",
Containers: map[string]
Jobs: []params.
@@ -203,20 +206,25 @@
SubordinateTo: []string{},
Units: map[string]
"