apiserver

package
v0.0.0-...-b9bb202 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2024 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const ConnectTopic = "apiserver.agent-connect"

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

View Source
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.

View Source
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.

View Source
const DisconnectTopic = "apiserver.agent-disconnect"

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

View Source
const PresenceRequestTopic = "presence.request"

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

View Source
const PresenceResponseTopic = "presence.response"

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

Variables

This section is empty.

Functions

This section is empty.

Types

type APIConnection

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

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

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

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

type OriginTarget common.OriginTarget

OriginTarget represents the data for the connect and disconnect topics.

type PresenceResponse

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

type Restart common.LocalOnly

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL