package node

import "github.com/docker/swarm/scheduler/node"

Index

Types

type Node

type Node struct {
	ID         string
	IP         string
	Addr       string
	Name       string
	Labels     map[string]string
	Containers cluster.Containers
	Images     []*cluster.Image

	UsedMemory  int64
	UsedCpus    int64
	TotalMemory int64
	TotalCpus   int64

	HealthIndicator int64
}

Node is an abstract type used by the scheduler.

func NewNode

func NewNode(e *cluster.Engine) *Node

NewNode creates a node from an engine.

func (*Node) AddContainer

func (n *Node) AddContainer(container *cluster.Container) error

AddContainer injects a container into the internal state.

func (*Node) Container

func (n *Node) Container(IDOrName string) *cluster.Container

Container returns the container with IDOrName in the engine.

func (*Node) IsHealthy

func (n *Node) IsHealthy() bool

IsHealthy responses if node is in healthy state

Source Files

node.go

Version
v1.2.9 (latest)
Published
Jun 1, 2018
Platform
linux/amd64
Imports
2 packages
Last checked
3 weeks ago

Tools for package owners.