Getting the API server URL in workers
Andrew Wilkins
andrew.wilkins at canonical.com
Wed Sep 3 23:21:18 UTC 2014
On Wed, Sep 3, 2014 at 11:37 PM, William Reade <william.reade at canonical.com>
wrote:
> On Wed, Sep 3, 2014 at 4:49 PM, John Meinel <john at arbash-meinel.com>
> wrote:
> > It feels like this should be something that the API server is looking up
> in
> > the database/some sort of query, not just munging a URL. I'm fine with
> > having a Params struct, though I worry that it isn't really appropriate
> to
> > be passing all possible Params to all facades. They already have a State
> > connection, I'd like us to at least be designing the layering
> appropriately.
> > I feel like state.State is intended to be where "Knowledge" resides. Why
> > isn't what we want there?
>
> Yeah, constructing it based on the current known addresses of the
> state servers seems best. Do we maybe actually want a list of URLs
> where the tools are available? That'd be the HA thing to do, I
> suspect.
>
There's one place we're doing that already, and that's in the cloud-init
script.
The other use of the tools URL is in the upgrader, where it doesn't really
matter assuming it returns a URL to the same API server as returned the
metadata. The client will be severed anyway, and reconnect and re-query and
get another URL. Also, multiple URLs would be useless for older clients
upgrading.
Anyway, I'll have another dig at it.
Cheers, Andrew
> Cheers
> William
>
> >
> > John
> > =:->
> >
> > On Sep 3, 2014 6:03 PM, "Andrew Wilkins" <andrew.wilkins at canonical.com>
> > wrote:
> >>
> >> I'm working on moving all tools downloads to download from the API
> server.
> >> There will are a few APIs that return tools:
> >> - Upgrader.Tools
> >> - Client.FindTools
> >> - Provisioner.FindTools
> >>
> >> These APIs will need to return URLs pointing at the API server. I'm
> >> intending to change the facade constructors to take a parameter struct,
> and
> >> extend it with the API server's root URL (i.e.
> >> https://<address>:<port>/environment/<uuid>), where the address is the
> one
> >> used by the client to connect.
> >>
> >> Any reason I should not go ahead and do that? This will probably make it
> >> easier to slot in a "Restarter" or whatever as well.
> >>
> >> Cheers,
> >> Andrew
> >>
> >> --
> >> Juju-dev mailing list
> >> Juju-dev at lists.ubuntu.com
> >> Modify settings or unsubscribe at:
> >> https://lists.ubuntu.com/mailman/listinfo/juju-dev
> >>
> >
> > --
> > Juju-dev mailing list
> > Juju-dev at lists.ubuntu.com
> > Modify settings or unsubscribe at:
> > https://lists.ubuntu.com/mailman/listinfo/juju-dev
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju-dev/attachments/20140904/2062ef20/attachment-0001.html>
More information about the Juju-dev
mailing list