juju: github.com/juju/juju/state/multiwatcher Index | Files

package multiwatcher

import "github.com/juju/juju/state/multiwatcher"

Index

Package Files

multiwatcher.go

func AnyJobNeedsState Uses

func AnyJobNeedsState(jobs ...MachineJob) bool

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

type ActionInfo Uses

type ActionInfo struct {
    ModelUUID  string                 `json:"model-uuid"`
    Id         string                 `json:"id"`
    Receiver   string                 `json:"receiver"`
    Name       string                 `json:"name"`
    Parameters map[string]interface{} `json:"parameters,omitempty"`
    Status     string                 `json:"status"`
    Message    string                 `json:"message"`
    Results    map[string]interface{} `json:"results,omitempty"`
    Enqueued   time.Time              `json:"enqueued"`
    Started    time.Time              `json:"started"`
    Completed  time.Time              `json:"completed"`
}

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

func (*ActionInfo) EntityId Uses

func (i *ActionInfo) EntityId() EntityId

EntityId returns a unique identifier for an action across models.

type Address Uses

type Address struct {
    Value           string `json:"value"`
    Type            string `json:"type"`
    Scope           string `json:"scope"`
    SpaceName       string `json:"space-name,omitempty"`
    SpaceProviderId string `json:"space-provider-id,omitempty"`
}

Address describes a network address.

type AnnotationInfo Uses

type AnnotationInfo struct {
    ModelUUID   string            `json:"model-uuid"`
    Tag         string            `json:"tag"`
    Annotations map[string]string `json:"annotations"`
}

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

func (*AnnotationInfo) EntityId Uses

func (i *AnnotationInfo) EntityId() EntityId

EntityId returns a unique identifier for an annotation across models.

type ApplicationInfo Uses

type ApplicationInfo struct {
    ModelUUID       string                 `json:"model-uuid"`
    Name            string                 `json:"name"`
    Exposed         bool                   `json:"exposed"`
    CharmURL        string                 `json:"charm-url"`
    OwnerTag        string                 `json:"owner-tag"`
    Life            Life                   `json:"life"`
    MinUnits        int                    `json:"min-units"`
    Constraints     constraints.Value      `json:"constraints"`
    Config          map[string]interface{} `json:"config,omitempty"`
    Subordinate     bool                   `json:"subordinate"`
    Status          StatusInfo             `json:"status"`
    WorkloadVersion string                 `json:"workload-version"`
}

ApplicationInfo holds the information about an application that is tracked by multiwatcherStore.

func (*ApplicationInfo) EntityId Uses

func (i *ApplicationInfo) EntityId() EntityId

EntityId returns a unique identifier for an application across models.

type ApplicationOfferInfo Uses

type ApplicationOfferInfo struct {
    ModelUUID            string `json:"model-uuid"`
    OfferName            string `json:"offer-name"`
    OfferUUID            string `json:"offer-uuid"`
    ApplicationName      string `json:"application-name"`
    CharmName            string `json:"charm-name"`
    TotalConnectedCount  int    `json:"total-connected-count"`
    ActiveConnectedCount int    `json:"active-connected-count"`
}

ApplicationOfferInfo holds the information about an application offer that is tracked by multiwatcherStore.

func (*ApplicationOfferInfo) EntityId Uses

func (i *ApplicationOfferInfo) EntityId() EntityId

EntityId returns a unique identifier for an application offer across models.

type BlockInfo Uses

type BlockInfo struct {
    ModelUUID string    `json:"model-uuid"`
    Id        string    `json:"id"`
    Type      BlockType `json:"type"`
    Message   string    `json:"message"`
    Tag       string    `json:"tag"`
}

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

func (*BlockInfo) EntityId Uses

func (i *BlockInfo) EntityId() EntityId

EntityId returns a unique identifier for a block across models.

type BlockType Uses

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 CharmInfo Uses

type CharmInfo struct {
    ModelUUID    string   `json:"model-uuid"`
    CharmURL     string   `json:"charm-url"`
    CharmVersion string   `json:"charm-version"`
    Life         Life     `json:"life"`
    LXDProfile   *Profile `json:"profile"`
    // DefaultConfig is derived from state-stored *charm.Config.
    DefaultConfig map[string]interface{} `json:"config,omitempty"`
}

CharmInfo holds the information about a charm that is tracked by the multiwatcher.

func (*CharmInfo) EntityId Uses

func (i *CharmInfo) EntityId() EntityId

EntityId returns a unique identifier for an charm across models.

type CharmRelation Uses

type CharmRelation struct {
    Name      string `json:"name"`
    Role      string `json:"role"`
    Interface string `json:"interface"`
    Optional  bool   `json:"optional"`
    Limit     int    `json:"limit"`
    Scope     string `json:"scope"`
}

CharmRelation is a mirror struct for charm.Relation.

func NewCharmRelation Uses

func NewCharmRelation(cr charm.Relation) CharmRelation

NewCharmRelation creates a new local CharmRelation structure from the charm.Relation structure. NOTE: when we update the database to not store a charm.Relation directly in the database, this method should take the state structure type.

type Delta Uses

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

Delta holds details of a change to the model.

func (*Delta) MarshalJSON Uses

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

MarshalJSON implements json.Marshaler.

func (*Delta) UnmarshalJSON Uses

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

UnmarshalJSON implements json.Unmarshaler.

type Endpoint Uses

type Endpoint struct {
    ApplicationName string        `json:"application-name"`
    Relation        CharmRelation `json:"relation"`
}

Endpoint holds an application-relation pair.

type EntityId Uses

type EntityId struct {
    Kind      string `json:"kind"`
    ModelUUID string `json:"model-uuid"`
    Id        string `json:"id"`
}

EntityId uniquely identifies an entity being tracked by the multiwatcherStore.

type EntityInfo Uses

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 GenerationInfo Uses

type GenerationInfo struct {
    ModelUUID     string                  `json:"model-uuid"`
    Id            string                  `json:"id"`
    Name          string                  `json:"name"`
    AssignedUnits map[string][]string     `json:"assigned-units"`
    Config        map[string][]ItemChange `json:"charm-config"`
    Created       int64                   `json:"created"`
    CreatedBy     string                  `json:"created-by"`
    Completed     int64                   `json:"completed"`
    CompletedBy   string                  `json:"completed-by"`
    GenerationId  int                     `json:"generation-id"`
}

GenerationInfo holds data about a model generation (branch) that is tracked by multiwatcherStore.

func (*GenerationInfo) EntityId Uses

func (i *GenerationInfo) EntityId() EntityId

EntityId returns a unique identifier for a generation.

type ItemChange Uses

type ItemChange struct {
    Type     int         `json:"type"`
    Key      string      `json:"key"`
    OldValue interface{} `json:"old,omitempty"`
    NewValue interface{} `json:"new,omitempty"`
}

ItemChange is the multiwatcher representation of a core settings ItemChange.

type Life Uses

type Life string

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

type MachineInfo Uses

type MachineInfo struct {
    ModelUUID                string                            `json:"model-uuid"`
    Id                       string                            `json:"id"`
    InstanceId               string                            `json:"instance-id"`
    AgentStatus              StatusInfo                        `json:"agent-status"`
    InstanceStatus           StatusInfo                        `json:"instance-status"`
    Life                     Life                              `json:"life"`
    Config                   map[string]interface{}            `json:"config,omitempty"`
    Series                   string                            `json:"series"`
    ContainerType            string                            `json:"container-type"`
    SupportedContainers      []instance.ContainerType          `json:"supported-containers"`
    SupportedContainersKnown bool                              `json:"supported-containers-known"`
    HardwareCharacteristics  *instance.HardwareCharacteristics `json:"hardware-characteristics,omitempty"`
    CharmProfiles            []string                          `json:"charm-profiles,omitempty"`
    Jobs                     []MachineJob                      `json:"jobs"`
    Addresses                []Address                         `json:"addresses"`
    HasVote                  bool                              `json:"has-vote"`
    WantsVote                bool                              `json:"wants-vote"`
}

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

func (*MachineInfo) EntityId Uses

func (i *MachineInfo) EntityId() EntityId

EntityId returns a unique identifier for a machine across models.

type MachineJob Uses

type MachineJob string

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

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

func (MachineJob) NeedsState Uses

func (job MachineJob) NeedsState() bool

NeedsState returns true if the job requires a state connection.

type ModelInfo Uses

type ModelInfo struct {
    ModelUUID      string                 `json:"model-uuid"`
    Name           string                 `json:"name"`
    Life           Life                   `json:"life"`
    Owner          string                 `json:"owner"`
    ControllerUUID string                 `json:"controller-uuid"`
    IsController   bool                   `json:"is-controller"`
    Config         map[string]interface{} `json:"config,omitempty"`
    Status         StatusInfo             `json:"status"`
    Constraints    constraints.Value      `json:"constraints"`
    SLA            ModelSLAInfo           `json:"sla"`
}

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

func (*ModelInfo) EntityId Uses

func (i *ModelInfo) EntityId() EntityId

EntityId returns a unique identifier for a model.

type ModelSLAInfo Uses

type ModelSLAInfo struct {
    Level string `json:"level"`
    Owner string `json:"owner"`
}

ModelSLAInfo describes the SLA info for a model. Note: this replicates the type of the same name in the params package.

type Port Uses

type Port struct {
    Protocol string `json:"protocol"`
    Number   int    `json:"number"`
}

Port identifies a network port number for a particular protocol.

type PortRange Uses

type PortRange struct {
    FromPort int    `json:"from-port"`
    ToPort   int    `json:"to-port"`
    Protocol string `json:"protocol"`
}

PortRange represents a single range of ports.

type Profile Uses

type Profile struct {
    Config      map[string]string            `json:"config,omitempty"`
    Description string                       `json:"description,omitempty"`
    Devices     map[string]map[string]string `json:"devices,omitempty"`
}

Profile is a representation of charm.v6 LXDProfile

type RelationInfo Uses

type RelationInfo struct {
    ModelUUID string     `json:"model-uuid"`
    Key       string     `json:"key"`
    Id        int        `json:"id"`
    Endpoints []Endpoint `json:"endpoints"`
}

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

func (*RelationInfo) EntityId Uses

func (i *RelationInfo) EntityId() EntityId

EntityId returns a unique identifier for a relation across models.

type RemoteApplicationInfo Uses

type RemoteApplicationInfo struct {
    ModelUUID string     `json:"model-uuid"`
    Name      string     `json:"name"`
    OfferUUID string     `json:"offer-uuid"`
    OfferURL  string     `json:"offer-url"`
    Life      Life       `json:"life"`
    Status    StatusInfo `json:"status"`
}

RemoteApplicationInfo holds the information about a remote application that is tracked by multiwatcherStore.

func (*RemoteApplicationInfo) EntityId Uses

func (i *RemoteApplicationInfo) EntityId() EntityId

EntityId returns a unique identifier for a remote application across models.

type StatusInfo Uses

type StatusInfo struct {
    Err     error                  `json:"err,omitempty"`
    Current status.Status          `json:"current"`
    Message string                 `json:"message"`
    Since   *time.Time             `json:"since,omitempty"`
    Version string                 `json:"version"`
    Data    map[string]interface{} `json:"data,omitempty"`
}

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

func NewStatusInfo Uses

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

NewStatusInfo return a new multiwatcher StatusInfo from a status StatusInfo.

type UnitInfo Uses

type UnitInfo struct {
    ModelUUID      string      `json:"model-uuid"`
    Name           string      `json:"name"`
    Application    string      `json:"application"`
    Series         string      `json:"series"`
    CharmURL       string      `json:"charm-url"`
    Life           Life        `json:"life"`
    PublicAddress  string      `json:"public-address"`
    PrivateAddress string      `json:"private-address"`
    MachineId      string      `json:"machine-id"`
    Ports          []Port      `json:"ports"`
    PortRanges     []PortRange `json:"port-ranges"`
    Principal      string      `json:"principal"`
    Subordinate    bool        `json:"subordinate"`
    // Workload and agent state are modelled separately.
    WorkloadStatus StatusInfo `json:"workload-status"`
    AgentStatus    StatusInfo `json:"agent-status"`
}

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

func (*UnitInfo) EntityId Uses

func (i *UnitInfo) EntityId() EntityId

EntityId returns a unique identifier for a unit across models.

Package multiwatcher imports 9 packages (graph) and is imported by 1178 packages. Updated 2019-06-22. Refresh now. Tools for package owners.