events

package
v0.0.0-...-81a99f1 Latest Latest
Warning

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

Go to latest
Published: May 24, 2016 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container struct {
	ID               string
	UUID             string
	Version          string
	Name             string
	Description      string
	ServiceName      string
	StackName        string
	State            InstanceState
	HealthState      HealthState
	Environment      map[string]string
	Labels           map[string]string
	Metadata         map[string]interface{}
	PrimaryIpAddress string
	Ports            []string
	ImageUUID        string
	HostID           string
}

type Endpoints

type Endpoints struct {
	IPAddress string
	Port      int
}

type Event

type Event struct {
	ID            string
	Timestamp     time.Time
	Kind          EventKind
	ContainerData Container
	HostData      Host
	ServiceData   Service
	StackData     Stack
}

Event is used to store information relating to a Rancher API "resource.change" event

func New

func New(id string, kind EventKind, resourceData map[string]interface{}) (Event, error)

func (Event) GetHealthState

func (ev Event) GetHealthState() HealthState

func (Event) GetName

func (ev Event) GetName() string

func (Event) GetState

func (ev Event) GetState() InstanceState

func (Event) String

func (ev Event) String() string

type EventKind

type EventKind string
const (
	ContainerEvent EventKind = "container"
	HostEvent      EventKind = "host"
	ServiceEvent   EventKind = "service"
	StackEvent     EventKind = "stack"
)

type HealthState

type HealthState string
const (
	// Common health states
	StateHealthy           HealthState = "healthy"
	StateUnhealthy         HealthState = "unhealthy"
	StateUpdatingHealthy   HealthState = "updating-healthy"
	StateUpdatingUnhealthy HealthState = "updating-unhealthy"
	StateReconcile         HealthState = "reconcile"
	StateInitializing      HealthState = "initializing"
	StateReinitializing    HealthState = "reinitializing"

	// Service specific health states
	StateDegraded    HealthState = "degraded"
	StateStartedOnce HealthState = "started-once"

	// Unknown
	StateUnknown HealthState = "n/a"
)

type Host

type Host struct {
	ID              string
	UUID            string
	Name            string
	Description     string
	State           InstanceState
	AgentState      string
	Labels          map[string]string
	Hostname        string
	PublicEndpoints []Endpoints
}

type InstanceState

type InstanceState string
const (
	// Service states
	ServiceInactive         InstanceState = "inactive"
	ServiceActivating       InstanceState = "activating"
	ServiceActive           InstanceState = "active"
	ServiceUpdatingActive   InstanceState = "updating-active"
	ServiceUpdatingInactive InstanceState = "updating-inactive"
	ServiceUpgraded

	// Container states
	ContainerStopping   InstanceState = "stopping"
	ContainerStopped    InstanceState = "stopped"
	ContainerStarting   InstanceState = "starting"
	ContainerRunning    InstanceState = "running"
	ContainerRestarting InstanceState = "restarting"

	// Host states
	HostInactive   InstanceState = "inactive"
	HostActivating InstanceState = "activating"
	HostActive     InstanceState = "active"
)

type Service

type Service struct {
	ID          string
	UUID        string
	Version     string
	Name        string
	Description string
	Scale       int
	State       InstanceState
	HealthState HealthState
	Metadata    map[string]interface{}
	Fqdn        string
	Vip         string
}

type Stack

type Stack struct {
	ID          string
	UUID        string
	Name        string
	Description string
	State       InstanceState
	HealthState HealthState
}

Jump to

Keyboard shortcuts

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