juju: github.com/juju/juju/pubsub/apiserver Index | Files

package apiserver

import "github.com/juju/juju/pubsub/apiserver"


Package Files



const ConnectTopic = "apiserver.agent-connect"

ConnectTopic is the topic name for the published message whenever an agent conntects to the API server. data: `APIConnection`

const DetailsRequestTopic = "apiserver.details-request"

DetailsRequestTopic is the topic that details requests are published on. The peergrouper responds those requests, publishing the current details on the DetailsTopic.

const DetailsTopic = "apiserver.details"

DetailsTopic is the topic name for the published message when the details of the api servers change. This message is normally published by the peergrouper when the set of API servers changes.

const DisconnectTopic = "apiserver.agent-disconnect"

DisconnectTopic is the topic name for the published message whenever an agent disconntects to the API server. data: `APIConnection`

const PresenceRequestTopic = "presence.request"

PresenceRequestTopic is used by the presence worker to ask another HA server to report its connections. data: `OriginTarget`

const PresenceResponseTopic = "presence.response"

PresenceResponseTopic is used by the presence worker to respond to the request topic above. data: `PresenceResponse`

const RestartTopic = "apiserver.restart"

RestartTopic is used by the API server to listen for events that should cause the API server to be bounced.

type APIConnection Uses

type APIConnection struct {
    AgentTag        string `yaml:"agent-tag"`
    ControllerAgent bool   `yaml:"controller-agent,omitempty"`
    ModelUUID       string `yaml:"model-uuid"`
    ConnectionID    uint64 `yaml:"connection-id"`
    Origin          string `yaml:"origin"`
    UserData        string `yaml:"user-data,omitempty"`

APIConnection holds all the salient pieces of information that are available when an agent connects to the API server.

type APIServer Uses

type APIServer struct {
    // ID contains the Juju machine ID for the apiserver.
    ID  string `yaml:"id"`

    // Addresses contains all of the usable addresses of the
    // apiserver machine.
    Addresses []string `yaml:"addresses"`

    // InternalAddress, if non-empty, is the address that
    // other API servers should use to connect to this API
    // server, in the form addr:port.
    // This may be empty if the API server is not fully
    // initialised.
    InternalAddress string `yaml:"internal-address,omitempty"`

APIServer contains the machine id and addresses of a single API server machine.

type Details Uses

type Details struct {
    // Servers is a map of machine ID to the details for that server.
    Servers   map[string]APIServer `yaml:"servers"`
    LocalOnly bool                 `yaml:"local-only"`

Details contains the ids and addresses of all the current API server machines.

type DetailsRequest Uses

type DetailsRequest struct {
    Requester string `yaml:"requester"`
    LocalOnly bool   `yaml:"local-only"`

DetailsRequest indicates the worker who is asking for the details to be sent. It should always be LocalOnly - we only want to ask our local PeerGrouper for details.

type OriginTarget Uses

type OriginTarget common.OriginTarget

OriginTarget represents the data for the connect and disconnect topics.

type PresenceResponse Uses

type PresenceResponse struct {
    Origin      string          `yaml:"origin"`
    Connections []APIConnection `yaml:"connections"`

PresenceResponse contains all of the current connections for the server identified by Origin.

type Restart Uses

type Restart common.LocalOnly

Restart message only contains the local-only indicator as the restart is only ever for the same agent.

Package apiserver imports 1 packages (graph) and is imported by 46 packages. Updated 2018-09-01. Refresh now. Tools for package owners.