types

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: May 3, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	ID               string    `json:"id,omitempty"`
	Name             string    `json:"name"`
	Instances        int       `json:"instances"`
	UpdatedInstances int       `json:"updatedInstances"`
	RunningInstances int       `json:"runningInstances"`
	RunAs            string    `json:"runAs"`
	Priority         int       `json:"priority"`
	ClusterID        string    `json:"clusterID,omitempty"`
	Status           string    `json:"status,omitempty"`
	Created          time.Time `json:"created,omitempty"`
	Updated          time.Time `json:"updated,omitempty"`
	Mode             string    `json:"mode"`
	State            string    `json:"state,omitempty"`

	// use task for compatability now, should be slot here
	Tasks          []*Task  `json:"tasks,omitempty"`
	CurrentVersion *Version `json:"currentVersion"`
	// use when app updated, ProposedVersion can either be commit or revert
	ProposedVersion *Version `json:"proposedVersion,omitempty"`
	Versions        []string `json:"versions,omitempty"`
	IP              []string `json:"ip,omitempty"`

	// current version related info
	Labels      map[string]string `json:"labels,omitempty"`
	Env         map[string]string `json:"env,omitempty"`
	Constraints string            `json:"constraints,omitempty"`
	URIs        []string          `json:"uris,omitempty"`
}

type AppFilterOptions added in v0.1.3

type AppFilterOptions struct {
	LabelsSelector labels.Selector
	FieldsSelector fields.Selector
}

type AppInfoEvent added in v0.1.3

type AppInfoEvent struct {
	AppID     string `json:"appID"`
	Name      string `json:"name"`
	State     string `json:"state"`
	ClusterID string `json:"clusterID"`
	RunAs     string `json:"runAs"`
	Mode      string `json:"mode"`
}

type Container

type Container struct {
	Type    string    `json:"type"`
	Docker  *Docker   `json:"docker"`
	Volumes []*Volume `json:"volumes,omitempty"`
}

type Docker

type Docker struct {
	ForcePullImage bool           `json:"forcePullImage,omitempty"`
	Image          string         `json:"image"`
	Network        string         `json:"network,omitempty"`
	Parameters     []*Parameter   `json:"parameters,omitempty"`
	PortMappings   []*PortMapping `json:"portMappings,omitempty"`
	Privileged     bool           `json:"privileged,omitempty"`
}

type FrameworkInfo added in v0.1.7

type FrameworkInfo struct {
	ID string
}

type HealthCheck

type HealthCheck struct {
	ID                  string  `json:"id,omitempty"`
	Address             string  `json:"address,omitempty"`
	TaskID              string  `json:"taskID,omitempty"`
	AppID               string  `json:"appID,omitempty"`
	Protocol            string  `json:"protocol,omitempty"`
	PortName            string  `json:"portName,omitempty"`
	Value               string  `json:"value,omitempty"`
	Path                string  `json:"path,omitempty"`
	ConsecutiveFailures uint32  `json:"consecutiveFailures,omitempty"`
	GracePeriodSeconds  float64 `json:"gracePeriodSeconds,omitempty"`
	IntervalSeconds     float64 `json:"intervalSeconds,omitempty"`
	TimeoutSeconds      float64 `json:"timeoutSeconds,omitempty"`
	DelaySeconds        float64 `json:"delaySeconds,omitempty"`
}

type JanitorAcceptor

type JanitorAcceptor struct {
	ID         string `json:"id"`
	RemoteAddr string `json:"remoteAddr"`
	Status     string `json:"status"`
}

type KillPolicy

type KillPolicy struct {
	Duration int64 `json:"duration,omitempty"`
}

type Parameter

type Parameter struct {
	Key   string `json:"key,omitempty"`
	Value string `json:"value,omitempty"`
}

type PortMapping

type PortMapping struct {
	ContainerPort int32  `json:"containerPort,omitempty"`
	HostPort      int32  `json:"hostPort,omitempty"`
	Name          string `json:"name,omitempty"`
	Protocol      string `json:"protocol,omitempty"`
}

type ProceedUpdateParam

type ProceedUpdateParam struct {
	Instances  int                `json:"instances"`
	NewWeights map[string]float64 `json:"weights"`
}

type ResolverAcceptor

type ResolverAcceptor struct {
	ID         string `json:"id"`
	RemoteAddr string `json:"remoteAddr"`
	Status     string `json:"status"`
}

type ScaleDownParam

type ScaleDownParam struct {
	Instances int `json:"instances"`
}

type ScaleUpParam

type ScaleUpParam struct {
	Instances int      `json:"instances"`
	IPs       []string `json:"ips"`
}

type ServiceDiscovery added in v0.1.3

type ServiceDiscovery struct {
	TaskID           string             `json:"taskID"`
	AppID            string             `json:"appID"`
	AppMode          string             `json:"appMode"`
	IP               string             `json:"ip"`
	TaskPortMappings []*TaskPortMapping `json:"taskPortMappings"`
	URL              string             `json:"url"`
}

type Stats

type Stats struct {
	ClusterID string `json:"clusterID"`

	AppCount  int `json:"appCount"`
	TaskCount int `json:"taskCount"`

	Created float64 `json:"created"`

	Master string `json:"master"`
	Slaves string `json:"slaves"`

	Attributes []map[string]interface{} `json:"attributes"`

	TotalCpu  float64 `json:"totalCpu"`
	TotalMem  float64 `json:"totalMem"`
	TotalDisk float64 `json:"totalDisk"`

	CpuTotalOffered  float64 `json:"cpuTotalOffered"`
	MemTotalOffered  float64 `json:"memTotalOffered"`
	DiskTotalOffered float64 `json:"diskTotalOffered"`

	CpuTotalUsed  float64 `json:"cpuTotalUsed"`
	MemTotalUsed  float64 `json:"memTotalUsed"`
	DiskTotalUsed float64 `json:"diskTotalUsed"`

	AppStats map[string]int `json:"appStats,omitempty"`
}

type Task

type Task struct {
	ID         string `json:"id,omitempty"`
	AppID      string `json:"appID"`
	SlotID     string `json:"slotID"`
	VersionID  string `json:"versionID"`
	AppVersion string `json:"appVersion"`

	Status string `json:"status,omitempty"`

	OfferID       string `json:"offerID,omitempty"`
	AgentID       string `json:"agentID,omitempty"`
	AgentHostname string `json:"agentHostname,omitempty"`

	CPU  float64 `json:"cpu"`
	Mem  float64 `json:"mem"`
	Disk float64 `json:"disk"`

	History []*TaskHistory `json:"history,omitempty"`

	IP    string   `json:"ip,omitempty"`
	Ports []uint64 `json:"ports,omitempty"`

	Created time.Time `json:"created,omitempty"`

	Image   string `json:"image"`
	Healthy bool   `json:"healthy"`

	ContainerId   string  `json:"containerId"`
	ContainerName string  `json:"containerName"`
	Weight        float64 `json:"weight"`
}

use task for compatability now, should be slot here and together with task history

type TaskHistory

type TaskHistory struct {
	ID         string `json:"id"`
	AppID      string `json:"appID"`
	VersionID  string `json:"versionID"`
	AppVersion string `json:"appVersion"`

	OfferID       string `json:"offerID"`
	AgentID       string `json:"agentID"`
	AgentHostname string `json:"agentHostname"`

	CPU  float64 `json:"cpu"`
	Mem  float64 `json:"mem"`
	Disk float64 `json:"disk"`

	State   string `json:"state,omitempty"`
	Reason  string `json:"reason,omitempty"`
	Message string `json:"message,omitempty"`
	Stdout  string `json:"stdout,omitempty"`
	Stderr  string `json:"stderr,omitempty"`

	ArchivedAt    time.Time `json:"archivedAt, omitempty"`
	ContainerId   string    `json:"containerId"`
	ContainerName string    `json:"containerName"`
	Weight        float64   `json:"weight,omitempty"`
}

type TaskInfoEvent added in v0.1.3

type TaskInfoEvent struct {
	IP         string  `json:"ip"`
	TaskID     string  `json:"taskID"`
	AppID      string  `json:"appID"`
	AppVersion string  `json:"appVersion"`
	VersionID  string  `json:"versionID"`
	Port       uint32  `json:"port"`
	PortName   string  `json:"portName"`
	State      string  `json:"state"`
	Healthy    bool    `json:"healthy"`
	ClusterID  string  `json:"clusterID"`
	RunAs      string  `json:"runAs"`
	Mode       string  `json:"mode"`
	Weight     float64 `json:"weight"`
	AppName    string  `json:"appName"`
	SlotIndex  int     `json:"slotIndex"`
}

type TaskPortMapping added in v0.1.3

type TaskPortMapping struct {
	HostPort      int32  `json:"hostPort"`
	ContainerPort int32  `json:"containerPort"`
	Name          string `json:"name"`
	Protocol      string `json:"protocol"`
}

type UpdatePolicy

type UpdatePolicy struct {
	UpdateDelay  int32  `json:"updateDelay,omitempty"`
	MaxRetries   int32  `json:"maxRetries,omitempty"`
	MaxFailovers int32  `json:"maxFailovers,omitempty"`
	Action       string `json:"action,omitempty"`
}

type UpdateWeightParam added in v0.1.11

type UpdateWeightParam struct {
	Weight float64 `json:"weight"`
}

type UpdateWeightsParam added in v0.1.11

type UpdateWeightsParam struct {
	Weights map[string]float64 `json:"weights"`
}

type Version

type Version struct {
	ID           string            `json:"id,omitempty"`
	AppName      string            `json:"appName,omitempty"`
	AppVersion   string            `json:"appVersion,omitempty"`
	Command      string            `json:"cmd,omitempty"`
	Args         []string          `json:"args,omitempty"`
	CPUs         float64           `json:"cpus"`
	Mem          float64           `json:"mem"`
	Disk         float64           `json:"disk"`
	Instances    int32             `json:"instances"`
	RunAs        string            `json:"runAs"`
	Priority     int32             `json:"priority"`
	Container    *Container        `json:"container"`
	Labels       map[string]string `json:"labels,omitempty"`
	HealthCheck  *HealthCheck      `json:"healthCheck,omitempty"`
	Env          map[string]string `json:"env,omitempty"`
	KillPolicy   *KillPolicy       `json:"killPolicy,omitempty"`
	UpdatePolicy *UpdatePolicy     `json:"updatPolicy,omitempty"`
	Constraints  string            `json:"constraints,omitempty"`
	URIs         []string          `json:"uris,omitempty"`
	IP           []string          `json:"ip,omitempty"`
}

func (*Version) AddLabel

func (v *Version) AddLabel(name, value string) *Version

AddLabel adds a label to the application

name:	the name of the label
value: value for this label

func (*Version) EmptyLabels

func (v *Version) EmptyLabels() *Version

EmptyLabels explicitly empties the labels -- use this if you need to empty the labels of an application that already has labels set (setting labels to nil will keep the current value)

type Volume

type Volume struct {
	ContainerPath string `json:"containerPath,omitempty"`
	HostPath      string `json:"hostPath,omitempty"`
	Mode          string `json:"mode,omitempty"`
}

Jump to

Keyboard shortcuts

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