Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1396)

Issue 54270043: Client.APIAddresses

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 3 months ago by jameinel
Modified:
10 years, 3 months ago
Reviewers:
dimitern, mp+202212
Visibility:
Public.

Description

Client.APIAddresses Expose the Server and Client sides of APIAddresses for a Client (user). This is a step towards bug #1268470 (make api-endpoints use the API rather than direct Provider access). I wanted to propose this first, so we can discuss it. I think the discussion is that new APIs should be on smaller facades than all of Client, but I wasn't quite sure where to put this. If we have a recognized spot for it, I'm happy to move the code over there. https://code.launchpad.net/~jameinel/juju-core/api-addresses-1268470/+merge/202212 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+84 lines, -3 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M state/api/client.go View 1 chunk +15 lines, -0 lines 0 comments Download
M state/apiserver/client/api_test.go View 1 chunk +5 lines, -1 line 1 comment Download
M state/apiserver/client/client.go View 2 chunks +3 lines, -1 line 0 comments Download
M state/apiserver/client/client_test.go View 2 chunks +42 lines, -0 lines 0 comments Download
M state/apiserver/client/perm_test.go View 3 chunks +17 lines, -1 line 0 comments Download

Messages

Total messages: 3
jameinel
Please take a look.
10 years, 3 months ago (2014-01-19 12:19:35 UTC) #1
dimitern
Looks good in general, but it might be worth to integrate this with juju/api.go (connection ...
10 years, 3 months ago (2014-01-20 11:41:04 UTC) #2
jameinel
10 years, 3 months ago (2014-01-21 10:45:30 UTC) #3
On 2014/01/20 11:41:04, dimitern wrote:
> Looks good in general, but it might be worth to integrate this with
juju/api.go
> (connection caching), i.e. once we connect to the api and we're about to
update
> the cache, call APIAddresses() and save the up-to-date addresses in the cache.
> 
>
https://codereview.appspot.com/54270043/diff/1/state/apiserver/client/api_tes...
> File state/apiserver/client/api_test.go (right):
> 
>
https://codereview.appspot.com/54270043/diff/1/state/apiserver/client/api_tes...
> state/apiserver/client/api_test.go:277: m, err :=
s.State.AddMachine("quantal",
> state.JobManageEnviron, state.JobManageState)
> You could replace a bunch of lines here if you use
> jujutesting.AddStateServerMachine, which does the same.

I did check into this at Roger's suggestion. And State.APIAddresses() uses
State.stateAddresses() which explicitly requests the private addresses. Which
means we need to change the other bits (maybe we just put it behind querying the
Provider for an initial implementation.)

I'm thinking to rename it slightly, either ClientAPIAddresses or
PublicAPIAddresses, or something to make it clear that the values returned by
this function won't actually match the values from State.APIAddresses.
I'm also considering changing it to return a struct, so we can pass other stuff
in.

For now, I'll just keep investigating.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b