multiwatcher

package
v0.0.0-...-2608902 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2016 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyJobNeedsState

func AnyJobNeedsState(jobs ...MachineJob) bool

AnyJobNeedsState returns true if any of the provided jobs require a state connection.

Types

type ActionInfo

type ActionInfo struct {
	ModelUUID  string
	Id         string
	Receiver   string
	Name       string
	Parameters map[string]interface{}
	Status     string
	Message    string
	Results    map[string]interface{}
	Enqueued   time.Time
	Started    time.Time
	Completed  time.Time
}

ActionInfo holds the information about a action that is tracked by multiwatcherStore.

func (*ActionInfo) EntityId

func (i *ActionInfo) EntityId() EntityId

EntityId returns a unique identifier for an action across models.

type AnnotationInfo

type AnnotationInfo struct {
	ModelUUID   string
	Tag         string
	Annotations map[string]string
}

AnnotationInfo holds the information about an annotation that is tracked by multiwatcherStore.

func (*AnnotationInfo) EntityId

func (i *AnnotationInfo) EntityId() EntityId

EntityId returns a unique identifier for an annotation across models.

type BlockInfo

type BlockInfo struct {
	ModelUUID string
	Id        string
	Type      BlockType
	Message   string
	Tag       string
}

BlockInfo holds the information about a block that is tracked by multiwatcherStore.

func (*BlockInfo) EntityId

func (i *BlockInfo) EntityId() EntityId

EntityId returns a unique identifier for a block across models.

type BlockType

type BlockType string

BlockType values define model block type.

const (
	// BlockDestroy type identifies destroy blocks.
	BlockDestroy BlockType = "BlockDestroy"

	// BlockRemove type identifies remove blocks.
	BlockRemove BlockType = "BlockRemove"

	// BlockChange type identifies change blocks.
	BlockChange BlockType = "BlockChange"
)

type Delta

type Delta struct {
	// If Removed is true, the entity has been removed;
	// otherwise it has been created or changed.
	Removed bool
	// Entity holds data about the entity that has changed.
	Entity EntityInfo
}

Delta holds details of a change to the model.

func (*Delta) MarshalJSON

func (d *Delta) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*Delta) UnmarshalJSON

func (d *Delta) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Endpoint

type Endpoint struct {
	ServiceName string
	Relation    charm.Relation
}

Endpoint holds a service-relation pair.

type EntityId

type EntityId struct {
	Kind      string
	ModelUUID string
	Id        string
}

EntityId uniquely identifies an entity being tracked by the multiwatcherStore.

type EntityInfo

type EntityInfo interface {
	// EntityId returns an identifier that will uniquely
	// identify the entity within its kind
	EntityId() EntityId
}

EntityInfo is implemented by all entity Info types.

type Life

type Life string

Life describes the lifecycle state of an entity ("alive", "dying" or "dead").

type MachineInfo

type MachineInfo struct {
	ModelUUID                string
	Id                       string
	InstanceId               string
	JujuStatus               StatusInfo
	MachineStatus            StatusInfo
	Life                     Life
	Series                   string
	SupportedContainers      []instance.ContainerType
	SupportedContainersKnown bool
	HardwareCharacteristics  *instance.HardwareCharacteristics `json:",omitempty"`
	Jobs                     []MachineJob
	Addresses                []network.Address
	HasVote                  bool
	WantsVote                bool
}

MachineInfo holds the information about a machine that is tracked by multiwatcherStore.

func (*MachineInfo) EntityId

func (i *MachineInfo) EntityId() EntityId

EntityId returns a unique identifier for a machine across models.

type MachineJob

type MachineJob string

MachineJob values define responsibilities that machines may be expected to fulfil.

const (
	JobHostUnits        MachineJob = "JobHostUnits"
	JobManageModel      MachineJob = "JobManageModel"
	JobManageNetworking MachineJob = "JobManageNetworking"
)

func (MachineJob) NeedsState

func (job MachineJob) NeedsState() bool

NeedsState returns true if the job requires a state connection.

type ModelInfo

type ModelInfo struct {
	ModelUUID  string
	Name       string
	Life       Life
	Owner      string
	ServerUUID string
}

ModelInfo holds the information about an model that is tracked by multiwatcherStore.

func (*ModelInfo) EntityId

func (i *ModelInfo) EntityId() EntityId

EntityId returns a unique identifier for an model.

type RelationInfo

type RelationInfo struct {
	ModelUUID string
	Key       string
	Id        int
	Endpoints []Endpoint
}

RelationInfo holds the information about a relation that is tracked by multiwatcherStore.

func (*RelationInfo) EntityId

func (i *RelationInfo) EntityId() EntityId

EntityId returns a unique identifier for a relation across models.

type ServiceInfo

type ServiceInfo struct {
	ModelUUID   string
	Name        string
	Exposed     bool
	CharmURL    string
	OwnerTag    string
	Life        Life
	MinUnits    int
	Constraints constraints.Value
	Config      map[string]interface{}
	Subordinate bool
	Status      StatusInfo
}

ServiceInfo holds the information about a service that is tracked by multiwatcherStore.

func (*ServiceInfo) EntityId

func (i *ServiceInfo) EntityId() EntityId

EntityId returns a unique identifier for a service across models.

type StatusInfo

type StatusInfo struct {
	Err     error
	Current status.Status
	Message string
	Since   *time.Time
	Version string
	Data    map[string]interface{}
}

StatusInfo holds the unit and machine status information. It is used by ServiceInfo and UnitInfo.

func NewStatusInfo

func NewStatusInfo(s status.StatusInfo, err error) StatusInfo

NewStatusInfo return a new multiwatcher StatusInfo from a status StatusInfo.

type UnitInfo

type UnitInfo struct {
	ModelUUID      string
	Name           string
	Service        string
	Series         string
	CharmURL       string
	PublicAddress  string
	PrivateAddress string
	MachineId      string
	Ports          []network.Port
	PortRanges     []network.PortRange
	Subordinate    bool
	// Workload and agent state are modelled separately.
	WorkloadStatus StatusInfo
	JujuStatus     StatusInfo
}

UnitInfo holds the information about a unit that is tracked by multiwatcherStore.

func (*UnitInfo) EntityId

func (i *UnitInfo) EntityId() EntityId

EntityId returns a unique identifier for a unit across models.

Jump to

Keyboard shortcuts

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