Merge lp:~axwalk/juju-core/apihostports-api into lp:~go-bot/juju-core/trunk
Proposed by
Andrew Wilkins
Status: | Merged |
---|---|
Approved by: | Andrew Wilkins |
Approved revision: | no longer in the source branch. |
Merged at revision: | 2503 |
Proposed branch: | lp:~axwalk/juju-core/apihostports-api |
Merge into: | lp:~go-bot/juju-core/trunk |
Diff against target: |
103 lines (+57/-7) 5 files modified
state/api/client.go (+9/-0) state/api/params/internal.go (+0/-7) state/api/params/params.go (+7/-0) state/apiserver/client/client.go (+8/-0) state/apiserver/client/client_test.go (+33/-0) |
To merge this branch: | bzr merge lp:~axwalk/juju-core/apihostports-api |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+213200@code.launchpad.net |
Commit message
Introduce APIHostPorts client API
I've added a APIHostPorts client API,
to allow clients to discover addresses
for additional API servers. There already
existed an internal API of the same name,
so I moved the result struct from
internal.go and reused it.
Description of the change
Introduce APIHostPorts client API
I've added a APIHostPorts client API,
to allow clients to discover addresses
for additional API servers. There already
existed an internal API of the same name,
so I moved the result struct from
internal.go and reused it.
To post a comment you must log in.
Reviewers: mp+213200_ code.launchpad. net,
Message:
Please take a look.
Description:
Introduce APIHostPorts client API
I've added a APIHostPorts client API,
to allow clients to discover addresses
for additional API servers. There already
existed an internal API of the same name,
so I moved the result struct from
internal.go and reused it.
https:/ /code.launchpad .net/~axwalk/ juju-core/ apihostports- api/+merge/ 213200
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/81340045/
Affected files (+59, -7 lines): params/ internal. go params/ params. go /client/ client. go /client/ client_ test.go
A [revision details]
M state/api/client.go
M state/api/
M state/api/
M state/apiserver
M state/apiserver
Index: [revision details] 20140327203820- qrgltgfsli0ff9c i
=== 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' HostPort, error) { APIHostPortsRes ult "APIHostPorts" , nil, &result); err != nil {
=== modified file 'state/
--- state/api/client.go 2014-03-26 17:19:35 +0000
+++ state/api/client.go 2014-03-28 05:59:48 +0000
@@ -666,3 +666,12 @@
}
return jsonResponse.Tools, nil
}
+
+// APIHostPorts returns a slice of instance.HostPort for each API server.
+func (c *Client) APIHostPorts() ([][]instance.
+ var result params.
+ if err := c.call(
+ return nil, err
+ }
+ return result.Servers, nil
+}
Index: state/api/ params/ internal. go api/params/ internal. go' params/ internal. go 2014-03-26 04:13:52 +0000 params/ internal. go 2014-03-28 05:59:48 +0000 HostPort
=== modified file 'state/
--- state/api/
+++ state/api/
@@ -532,10 +532,3 @@
type RunResults struct {
Results []RunResult
}
-
-// APIHostPortsResult holds the result of an APIHostPorts
-// call. Each element in the top level slice holds
-// the addresses for one API server.
-type APIHostPortsResult struct {
- Servers [][]instance.
-}
Index: state/api/ params/ params. go api/params/ params. go' params/ params. go 2014-03-27 12:53:54 +0000 params/ params. go 2014-03-28 05:59:48 +0000 arams struct { HostPort
=== modified file 'state/
--- state/api/
+++ state/api/
@@ -632,3 +632,10 @@
type SetRsyslogCertP
CACert []byte
}
+
+// APIHostPortsResult holds the result of an APIHostPorts
+// call. Each element in the top level slice holds
+// the addresses for one API server.
+type APIHostPortsResult struct {
+ Servers [][]instance.
+}
Index: state/apiserver /client/ client. go apiserver/ client/ client. go' /client/ client. go 2014-03-26 13:40:28 +0000 /client/ client. go 2014-03-28 05:59:48 +0000 APIHostPortsRes ult, err APIHostPorts( ); err != nil { APIHostPortsRes ult{}, err
=== modified file 'state/
--- state/apiserver
+++ state/apiserver
@@ -976,3 +976,11 @@
Entities: entityStatus,
})
}
+
+// APIHostPOrts returns the API host/port addresses stored in state.
+func (c *Client) APIHostPorts() (result params.
error) {
+ if result.Servers, err = c.api.state.
+ return params.
+ }
+ return result, nil
+}
Index: state/apiserver /cli...